Class: Bobkit::OptionsBase::OptionsHandler

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/bobkit/options_base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeOptionsHandler

Returns a new instance of OptionsHandler.



20
21
22
# File 'lib/bobkit/options_base.rb', line 20

def initialize
  @options = {}
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



18
19
20
# File 'lib/bobkit/options_base.rb', line 18

def options
  @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)
  options[key] = value if value
  options[key] ||= default
  options[key]
end