Class: Fusu::Configurable::Configuration

Inherits:
InheritableOptions show all
Defined in:
lib/fusu/configurable.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from InheritableOptions

#inheritable_copy, #initialize

Methods inherited from OrderedOptions

#[], #[]=, #method_missing, #respond_to_missing?

Constructor Details

This class inherits a constructor from Fusu::InheritableOptions

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Fusu::OrderedOptions

Class Method Details

.compile_methods!(keys) ⇒ Object

Compiles reader methods so we don’t have to go through method_missing.



16
17
18
19
20
21
22
# File 'lib/fusu/configurable.rb', line 16

def self.compile_methods!(keys)
  keys.reject { |m| method_defined?(m) }.each do |key|
    class_eval <<-RUBY, __FILE__, __LINE__ + 1
      def #{key}; _get(#{key.inspect}); end
    RUBY
  end
end

Instance Method Details

#compile_methods!Object



11
12
13
# File 'lib/fusu/configurable.rb', line 11

def compile_methods!
  self.class.compile_methods!(keys)
end