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
Class Method Details
.load(file, version) ⇒ Troo::API::Endpoints
31 32 33 |
# File 'lib/troo/api/endpoints.rb', line 31 def load(file, version) new(YAML.load_file(file)[version]) end |
Instance Method Details
#interpolate!(endpoint, value = {}) ⇒ String, EndpointNotFound
39 40 41 42 |
# File 'lib/troo/api/endpoints.rb', line 39 def interpolate!(endpoint, value = {}) return send(endpoint) % value if respond_to?(endpoint) fail EndpointNotFound end |