class Quickpress::Options
Hash that holds global program’s settings.
There should be only one instalce of it.
Public Class Methods
new()
click to toggle source
# File lib/quickpress/options.rb, line 9 def initialize @values = {} end
Public Instance Methods
[](label)
click to toggle source
# File lib/quickpress/options.rb, line 13 def [] label @values[label] end
[]=(label, val)
click to toggle source
# File lib/quickpress/options.rb, line 17 def []=(label, val) @values[label] = val end
merge!(other_hash)
click to toggle source
To add settings saved on other hash.
@note I don’t use Hash#merge because Thor’s
argument list creates a Hash with darn Strings as keys. I want symbols, dammit!
# File lib/quickpress/options.rb, line 27 def merge! other_hash other_hash.each do |key, val| @values[key.to_sym] = val end end