class AutoPilot::Config
Attributes
data[RW]
Public Class Methods
new(data = {})
click to toggle source
# File lib/auto_pilot/configure.rb, line 15 def initialize(data = {}) @data = {} update(data) end
Public Instance Methods
[](key)
click to toggle source
# File lib/auto_pilot/configure.rb, line 26 def [](key) @data[key.to_sym] end
[]=(key, value)
click to toggle source
# File lib/auto_pilot/configure.rb, line 30 def []=(key, value) @data[key.to_sym] = value end
method_missing(sym, *args)
click to toggle source
def to_hash
@data
end
# File lib/auto_pilot/configure.rb, line 42 def method_missing(sym, *args) if sym.to_s =~ /(.+)=$/ self[Regexp.last_match(1)] = args.first else self[sym] end end
update(data)
click to toggle source
# File lib/auto_pilot/configure.rb, line 20 def update(data) data.each do |key, value| self[key.to_sym] = value end end