Class: EbayTrader::FetchToken
- Defined in:
- lib/ebay_trader/fetch_token.rb
Overview
Fetch an eBay user authentication token using a SessionID value.
Constant Summary collapse
- CALL_NAME =
'FetchToken'
Constants inherited from Request
Instance Attribute Summary collapse
-
#session_id ⇒ Object
readonly
Returns the value of attribute session_id.
Attributes inherited from Request
#call_name, #ebay_site_id, #http_response_code, #http_timeout, #known_arrays, #message_id, #response_hash, #response_time, #skip_type_casting, #xml_request, #xml_response, #xml_tab_width
Instance Method Summary collapse
-
#auth_token ⇒ String
Get the authentication token.
-
#expiry_time ⇒ Time
Get the Time at which the authentication token expires.
-
#initialize(session_id, args = {}) ⇒ FetchToken
constructor
Construct a fetch token eBay API request with the given session ID.
Methods inherited from Request
#deep_find, #errors, #errors_and_warnings, #failure?, #has_errors?, #has_errors_or_warnings?, #has_warnings?, #partial_failure?, #success?, #timestamp, #to_json_s, #to_s, #warnings
Constructor Details
#initialize(session_id, args = {}) ⇒ FetchToken
Construct a fetch token eBay API request with the given session ID.
25 26 27 28 29 30 31 |
# File 'lib/ebay_trader/fetch_token.rb', line 25 def initialize(session_id, args = {}) session_id = session_id.id if session_id.is_a?(SessionID) @session_id = session_id.freeze super(CALL_NAME, args) do SessionID session_id end end |
Instance Attribute Details
#session_id ⇒ Object (readonly)
Returns the value of attribute session_id.
19 20 21 |
# File 'lib/ebay_trader/fetch_token.rb', line 19 def session_id @session_id end |
Instance Method Details
#auth_token ⇒ String
Get the authentication token.
36 37 38 |
# File 'lib/ebay_trader/fetch_token.rb', line 36 def auth_token response_hash[:ebay_auth_token] end |
#expiry_time ⇒ Time
Get the Time at which the authentication token expires.
43 44 45 |
# File 'lib/ebay_trader/fetch_token.rb', line 43 def expiry_time response_hash[:hard_expiration_time] end |