class ThemeBandit::Config
Attributes
data[RW]
Public Class Methods
new(data = {})
click to toggle source
# File lib/theme_bandit/util/configure.rb, line 15 def initialize(data = {}) @data = {} update!(data) end
Public Instance Methods
[](key)
click to toggle source
# File lib/theme_bandit/util/configure.rb, line 26 def [](key) @data[key.to_sym] end
[]=(key, value)
click to toggle source
# File lib/theme_bandit/util/configure.rb, line 30 def []=(key, value) @data[key.to_sym] = value end
keys()
click to toggle source
# File lib/theme_bandit/util/configure.rb, line 34 def keys @data.keys end
method_missing(sym, *args)
click to toggle source
# File lib/theme_bandit/util/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
to_hash()
click to toggle source
# File lib/theme_bandit/util/configure.rb, line 38 def to_hash @data end
update!(data)
click to toggle source
# File lib/theme_bandit/util/configure.rb, line 20 def update!(data) data.each do |key, value| self[key.to_sym] = value end end