diff options
-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 |