From 98267e69772bac32fa02021331277604dd530029 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Thu, 8 Oct 2009 22:36:50 +0200 Subject: get rid of SingletonMethods module in Optioned --- lib/ayk/options.rb | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/ayk/options.rb b/lib/ayk/options.rb index 5b34481..20951ad 100644 --- a/lib/ayk/options.rb +++ b/lib/ayk/options.rb @@ -147,14 +147,10 @@ module AYK # extend your class with this module Optioned def self.included(into) - into.extend(SingletonMethods) - snaked = into.name.split('::').last - snaked = snaked.gsub(/\B[A-Z][^A-Z]/, '_\&').downcase.gsub(' ', '_') - into.instance_variable_set :@options, Options.new(snaked) - end - # - module SingletonMethods - attr_reader :options + class << into + attr_reader :options + end + into.instance_variable_set :@options, Options.new( into.name.split('::').last.gsub(/\B[A-Z][^A-Z]/, '_\&').downcase.gsub(' ', '_') ) end # private -- cgit v1.1-2-g2b99