Class: Firefly::Config
- Inherits:
-
Hash
- Object
- Hash
- Firefly::Config
- Defined in:
- lib/firefly/config.rb
Constant Summary collapse
- DEFAULTS =
{ :hostname => "localhost:3000", :api_key => "test", :database => "sqlite3://#{Dir.pwd}/firefly_#{ENV['RACK_ENV']}.sqlite3", :recent_urls => 25, :tweet => "Check this out: %short_url%", :hyves_title => "Check this out", :hyves_body => "Check this out: %short_url%", :root_url => "http://example.com" }
Instance Method Summary collapse
-
#initialize(obj) ⇒ Config
constructor
A new instance of Config.
- #set(key, val = nil, &blk) ⇒ Object
Constructor Details
Instance Method Details
#set(key, val = nil, &blk) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/firefly/config.rb', line 21 def set key, val = nil, &blk if val.is_a? Hash self[key].update val else self[key] = block_given?? blk : val end end |