Sha256: 5d8e4aa1a1fa05b82534c7aa71af8e92364e0b245b8239ebf677f2ebbc64f08d

Contents?: true

Size: 515 Bytes

Versions: 5

Compression:

Stored size: 515 Bytes

Contents

module SecondAmendmentWholesale
  class Image < Base

    include SecondAmendmentWholesale::API

    def initialize(options = {})
      requires!(options, :token)
      @options = options

      @headers = [ 
        *auth_header(@options[:token]),
        *content_type_header('application/json'),
      ].to_h
    end

    def url(item_number)
      response = get_request("products/#{item_number}/media", @headers).body
      
      return response.first[:file] if response.present?
      nil
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
second_amendment_wholesale-1.0.5 lib/second_amendment_wholesale/image.rb
second_amendment_wholesale-1.0.3 lib/second_amendment_wholesale/image.rb
second_amendment_wholesale-1.0.2 lib/second_amendment_wholesale/image.rb
second_amendment_wholesale-1.0.1 lib/second_amendment_wholesale/image.rb
second_amendment_wholesale-1.0.0 lib/second_amendment_wholesale/image.rb