Sha256: 06bd52d7dd2054186bcd47b69a8b799c1bfdfd1b7c34170f391656efc9ba1a13

Contents?: true

Size: 558 Bytes

Versions: 4

Compression:

Stored size: 558 Bytes

Contents

require 'lipseys/api'

module Lipseys
  class Shipping < Base

    include Lipseys::API

    ENDPOINTS = {
      fetch: "shipping/oneday".freeze,
    }

    def initialize(client)
      @client = client
    end

    def fetch(since_date = nil)
      endpoint = ENDPOINTS[:fetch]
      since_date = (since_date || Time.now.prev_day).strftime('%m/%d/%Y')
      headers  = [
        *auth_header(@client.access_token),
        *content_type_header('application/json'),
      ].to_h

      post_request(endpoint, "\"#{since_date}\"", headers)
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
lipseys-6.2.1 lib/lipseys/shipping.rb
lipseys-6.2.0 lib/lipseys/shipping.rb
lipseys-6.1.1 lib/lipseys/shipping.rb
lipseys-6.1.0 lib/lipseys/shipping.rb