diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2009-10-08 22:36:50 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2011-06-30 08:08:53 +0200 |
commit | 98267e69772bac32fa02021331277604dd530029 (patch) | |
tree | 20376890f52518a62e910018e55958fe20ba005d | |
parent | 72a8a4e7aeff0fc93d2199c4d0cd25e3dffc1196 (diff) | |
download | ayk-98267e69772bac32fa02021331277604dd530029.zip ayk-98267e69772bac32fa02021331277604dd530029.tar.gz |
get rid of SingletonMethods module in Optioned
-rw-r--r-- | lib/ayk/options.rb | 12 |
1 files 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 |