Class: Lightspeed::API::Items
- Inherits:
-
Object
- Object
- Lightspeed::API::Items
- Defined in:
- lib/lightspeed/api/items.rb
Instance Method Summary collapse
- #archive(item_id) ⇒ Object
- #create(attributes = {}) ⇒ Object
- #find(item_id, with: []) ⇒ Object
-
#initialize(client) ⇒ Items
constructor
A new instance of Items.
Constructor Details
#initialize(client) ⇒ Items
Returns a new instance of Items.
4 5 6 |
# File 'lib/lightspeed/api/items.rb', line 4 def initialize(client) @client = client end |
Instance Method Details
#archive(item_id) ⇒ Object
16 17 18 |
# File 'lib/lightspeed/api/items.rb', line 16 def archive(item_id) client.delete("Account/#{client.account_id}/Item/#{item_id}.json").body end |
#create(attributes = {}) ⇒ Object
12 13 14 |
# File 'lib/lightspeed/api/items.rb', line 12 def create(attributes = {}) client.post("Account/#{client.account_id}/Item.json", body: attributes).body end |
#find(item_id, with: []) ⇒ Object
8 9 10 |
# File 'lib/lightspeed/api/items.rb', line 8 def find(item_id, with: []) client.get("Account/#{client.account_id}/Item/#{item_id}.json", relations: with).body end |