Class: YahooStoreApi::Client

Inherits:
Object
  • Object
show all
Includes:
Image, Item, Publish, Stock
Defined in:
lib/yahoo_store_api.rb

Constant Summary

Constants included from Helper

Helper::ENDPOINT

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Publish

#reserve_publish

Methods included from Helper

#connection, #error_parser, #handler, #response_parser

Methods included from Stock

#get_stock, #set_stock

Methods included from Image

#upload_item_image_pack

Methods included from Item

#delete_item, #edit_item, #get_item, #upload_item_file

Constructor Details

#initialize(seller_id:, application_id:, application_secret:, authorization_code: nil, redirect_uri: nil, refresh_token: nil) ⇒ Client

Returns a new instance of Client.



25
26
27
28
29
30
31
# File 'lib/yahoo_store_api.rb', line 25

def initialize(seller_id:, application_id:, application_secret:, authorization_code: nil, redirect_uri: nil, refresh_token: nil)
  @seller_id = seller_id
  @application_id = application_id
  @application_secret = application_secret
  @redirect_uri = redirect_uri ? "&redirect_uri=" + CGI.escape(redirect_uri) : nil
  @access_token = refresh_token.present? ? refresh_access_token(refresh_token) : get_access_token(authorization_code)
end

Instance Attribute Details

#refresh_tokenObject (readonly)

Returns the value of attribute refresh_token.



19
20
21
# File 'lib/yahoo_store_api.rb', line 19

def refresh_token
  @refresh_token
end