Class: Bobkit::OptionsBase::OptionsHandler
- Inherits:
-
Object
- Object
- Bobkit::OptionsBase::OptionsHandler
- Includes:
- Singleton
- Defined in:
- lib/bobkit/options_base.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize ⇒ OptionsHandler
constructor
A new instance of OptionsHandler.
- #setopt(key, value = nil, default = nil) ⇒ Object
Constructor Details
#initialize ⇒ OptionsHandler
Returns a new instance of OptionsHandler.
20 21 22 |
# File 'lib/bobkit/options_base.rb', line 20 def initialize @options = {} end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
18 19 20 |
# File 'lib/bobkit/options_base.rb', line 18 def @options end |
Instance Method Details
#setopt(key, value = nil, default = nil) ⇒ Object
24 25 26 27 28 |
# File 'lib/bobkit/options_base.rb', line 24 def setopt(key, value=nil, default=nil) [key] = value if value [key] ||= default [key] end |