Class: UnleashedClient::SalesOrder
- Inherits:
-
Object
- Object
- UnleashedClient::SalesOrder
- Defined in:
- lib/unleashed_client.rb
Instance Attribute Summary collapse
-
#api_id ⇒ Object
readonly
Returns the value of attribute api_id.
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
Instance Method Summary collapse
- #get_details(guid:) ⇒ Object
- #get_first_200 ⇒ Object
- #get_number_of_pages ⇒ Object
- #get_orders_from_page(page_number:) ⇒ Object
-
#initialize(api_key:, api_id:, query: "") ⇒ SalesOrder
constructor
A new instance of SalesOrder.
Constructor Details
#initialize(api_key:, api_id:, query: "") ⇒ SalesOrder
Returns a new instance of SalesOrder.
9 10 11 12 13 14 |
# File 'lib/unleashed_client.rb', line 9 def initialize(api_key:, api_id:, query: "") @api_key = api_key @api_id = api_id @query = query @unleashed_model = 'SalesOrders' end |
Instance Attribute Details
#api_id ⇒ Object (readonly)
Returns the value of attribute api_id.
7 8 9 |
# File 'lib/unleashed_client.rb', line 7 def api_id @api_id end |
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
7 8 9 |
# File 'lib/unleashed_client.rb', line 7 def api_key @api_key end |
Instance Method Details
#get_details(guid:) ⇒ Object
31 32 33 |
# File 'lib/unleashed_client.rb', line 31 def get_details(guid:) HTTP::Client.get_with_guid(api_id: @api_id, api_key: @api_key, query: @query, unleashed_model: @unleashed_model, guid: guid) end |
#get_first_200 ⇒ Object
21 22 23 24 |
# File 'lib/unleashed_client.rb', line 21 def get_first_200 response = HTTP::Client.get(api_id: @api_id, api_key: @api_key, query: @query, unleashed_model: @unleashed_model) response["Items"] end |
#get_number_of_pages ⇒ Object
16 17 18 19 |
# File 'lib/unleashed_client.rb', line 16 def get_number_of_pages response = HTTP::Client.get(api_id: @api_id, api_key: @api_key, query: @query, unleashed_model: @unleashed_model) response["Pagination"]["NumberOfPages"] end |
#get_orders_from_page(page_number:) ⇒ Object
26 27 28 29 |
# File 'lib/unleashed_client.rb', line 26 def get_orders_from_page(page_number:) response = HTTP::Client.get_from_page(api_id: @api_id, api_key: @api_key, query: @query, unleashed_model: @unleashed_model, page_number: page_number) response["Items"] end |