Class: Io::Flow::V0::Models::SessionVisit
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::SessionVisit
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
A session visit expires after a configurable period of inactivity (e.g. 30 minutes).
Instance Attribute Summary collapse
-
#expires_at ⇒ Object
readonly
Returns the value of attribute expires_at.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ SessionVisit
constructor
A new instance of SessionVisit.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ SessionVisit
Returns a new instance of SessionVisit.
30446 30447 30448 30449 30450 30451 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30446 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :expires_at], 'SessionVisit') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @expires_at = HttpClient::Preconditions.assert_class('expires_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:expires_at)), DateTime) end |
Instance Attribute Details
#expires_at ⇒ Object (readonly)
Returns the value of attribute expires_at.
30444 30445 30446 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30444 def expires_at @expires_at end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
30444 30445 30446 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30444 def id @id end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
30457 30458 30459 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30457 def copy(incoming={}) SessionVisit.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
30461 30462 30463 30464 30465 30466 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30461 def to_hash { :id => id, :expires_at => expires_at } end |
#to_json ⇒ Object
30453 30454 30455 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30453 def to_json JSON.dump(to_hash) end |