Class: EventHub::Configuration
- Inherits:
-
Object
- Object
- EventHub::Configuration
- Includes:
- Singleton
- Defined in:
- lib/eventhub/configuration.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #load_file(input, env = 'development') ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
8 9 10 |
# File 'lib/eventhub/configuration.rb', line 8 def initialize @data = nil end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
6 7 8 |
# File 'lib/eventhub/configuration.rb', line 6 def data @data end |
Instance Method Details
#load_file(input, env = 'development') ⇒ Object
12 13 14 15 |
# File 'lib/eventhub/configuration.rb', line 12 def load_file(input, env='development') tmp = JSON.parse( IO.read(input)) @data = tmp[env] end |