Class: Printful::StoresResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/printful/resources/stores.rb

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from Printful::Resource

Instance Method Details

#listObject



4
5
6
7
8
# File 'lib/printful/resources/stores.rb', line 4

def list
  response = get_request("stores")
  body = response.body["result"]
  Collection.from_response(body: body, type: Store)
end

#retrieve(id:) ⇒ Object



10
11
12
13
# File 'lib/printful/resources/stores.rb', line 10

def retrieve(id:)
  response = get_request("stores/#{id}")
  Store.new(response.body["result"])
end