Class: Troo::API::Endpoints
- Inherits:
-
Object
- Object
- Troo::API::Endpoints
- Defined in:
- lib/troo/api/endpoints.rb
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(endpoint, value = {}) ⇒ Troo::API::Endpoints constructor
- #interpolate ⇒ String, EndpointNotFound
Constructor Details
#initialize(endpoint, value = {}) ⇒ Troo::API::Endpoints
16 17 18 |
# File 'lib/troo/api/endpoints.rb', line 16 def initialize(endpoint, value = {}) @endpoint, @value = endpoint, value end |
Class Method Details
.interpolate(endpoint, value = {}) ⇒ String, EndpointNotFound
8 9 10 |
# File 'lib/troo/api/endpoints.rb', line 8 def interpolate(endpoint, value = {}) new(endpoint, value).interpolate end |
Instance Method Details
#interpolate ⇒ String, EndpointNotFound
23 24 25 26 27 |
# File 'lib/troo/api/endpoints.rb', line 23 def interpolate endpoints.fetch(endpoint) % value rescue KeyError fail EndpointNotFound end |