Class: Proselytism::Config
- Inherits:
-
Object
- Object
- Proselytism::Config
- Defined in:
- lib/proselytism/proselytism.rb
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #method_missing(method = nil, value = nil, &block) ⇒ Object
Constructor Details
#initialize ⇒ Config
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 |