Class: Ultron::Config
- Inherits:
-
Object
- Object
- Ultron::Config
- Includes:
- Singleton
- Defined in:
- lib/ultron/config.rb
Instance Method Summary collapse
- #config ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
-
#reset! ⇒ Object
testing a singleton is hard.
- #root_url ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
5 6 7 |
# File 'lib/ultron/config.rb', line 5 def initialize reset! end |
Instance Method Details
#config ⇒ Object
13 14 15 |
# File 'lib/ultron/config.rb', line 13 def config @config end |
#reset! ⇒ Object
testing a singleton is hard
9 10 11 |
# File 'lib/ultron/config.rb', line 9 def reset! # testing a singleton is hard @config = OpenStruct.new fetch_yaml 'ultron' end |
#root_url ⇒ Object
17 18 19 20 21 22 |
# File 'lib/ultron/config.rb', line 17 def root_url URI.join( Config.instance.config['host'], Config.instance.config['path'] ).to_s end |