Class: Troo::API::Endpoints

Inherits:
Object
  • Object
show all
Defined in:
lib/troo/api/endpoints.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.load(file, version) ⇒ Troo::API::Endpoints

Parameters:

  • (String)
  • (String)

Returns:



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

Parameters:

  • (Symbol)
  • (Hash)

Returns:



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