Class: Lago::Api::Resources::Quote

Inherits:
Base
  • Object
show all
Defined in:
lib/lago/api/resources/quote.rb

Instance Attribute Summary

Attributes inherited from Base

#client

Instance Method Summary collapse

Methods inherited from Base

#create, #destroy, #get, #get_all, #initialize, #update, #whitelist_params

Constructor Details

This class inherits a constructor from Lago::Api::Resources::Base

Instance Method Details

#api_resourceObject



11
12
13
# File 'lib/lago/api/resources/quote.rb', line 11

def api_resource
  'quotes'
end

#root_nameObject



15
16
17
# File 'lib/lago/api/resources/quote.rb', line 15

def root_name
  'quote'
end

#versions(quote_id, options = {}) ⇒ Object



19
20
21
22
23
24
# File 'lib/lago/api/resources/quote.rb', line 19

def versions(quote_id, options = {})
  path = "/api/v1/quotes/#{quote_id}/versions"
  response = connection.get_all(options, path)

  JSON.parse(response.to_json, object_class: OpenStruct)
end