Class: Hoth::ServiceModule::Environment
- Inherits:
-
Object
- Object
- Hoth::ServiceModule::Environment
- Defined in:
- lib/hoth/service_module.rb
Instance Attribute Summary collapse
-
#endpoints ⇒ Object
Returns the value of attribute endpoints.
Instance Method Summary collapse
- #[](endpoint_name) ⇒ Object
- #endpoint(endpoint_name, &block) ⇒ Object
-
#initialize(&block) ⇒ Environment
constructor
A new instance of Environment.
Constructor Details
#initialize(&block) ⇒ Environment
Returns a new instance of Environment.
8 9 10 11 |
# File 'lib/hoth/service_module.rb', line 8 def initialize(&block) @endpoints = {} instance_eval(&block) end |
Instance Attribute Details
#endpoints ⇒ Object
Returns the value of attribute endpoints.
6 7 8 |
# File 'lib/hoth/service_module.rb', line 6 def endpoints @endpoints end |
Instance Method Details
#[](endpoint_name) ⇒ Object
17 18 19 |
# File 'lib/hoth/service_module.rb', line 17 def [](endpoint_name) @endpoints[endpoint_name.to_sym] end |