Class: Proselytism::Config

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

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



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

def initialize
  @options ||= {}
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method = nil, value = nil, &block) ⇒ Object



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

def method_missing(method=nil, value=nil, &block)
  if method.to_s.match(/=$/)
    @options[method.to_s.gsub(/=$/,'')] = value
  else
    @options[method.to_s]
  end
end