Class: SecondAmendmentWholesale::Image
- Includes:
- API
- Defined in:
- lib/second_amendment_wholesale/image.rb
Constant Summary
Constants included from API
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Image
constructor
A new instance of Image.
- #url(item_number) ⇒ Object
Methods included from API
#delete_request, #get_request, #post_request, #put_request
Constructor Details
#initialize(options = {}) ⇒ Image
Returns a new instance of Image.
6 7 8 9 10 11 12 13 14 |
# File 'lib/second_amendment_wholesale/image.rb', line 6 def initialize( = {}) requires!(, :token) = @headers = [ *auth_header([:token]), *content_type_header('application/json'), ].to_h end |
Instance Method Details
#url(item_number) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/second_amendment_wholesale/image.rb', line 16 def url(item_number) response = get_request("products/#{item_number}/media", @headers).body return response.first[:file] if response.present? nil end |