Class: Mincer::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/mincer/config.rb

Instance Method Summary collapse

Instance Method Details

#add(processor, config_class) ⇒ Object



14
15
16
# File 'lib/mincer/config.rb', line 14

def add(processor, config_class)
  define_config_accessors(processor, config_class)
end

#define_config_accessors(processor, config_class) ⇒ Object



18
19
20
21
22
23
24
25
# File 'lib/mincer/config.rb', line 18

def define_config_accessors(processor, config_class)
  class_eval <<-ACCESORS, __FILE__
    def #{processor}
      @#{processor} ||= #{config_class}.new
      block_given? ? yield(@#{processor}) : @#{processor}
    end
  ACCESORS
end