Class: Io::Flow::V0::Models::SessionExpirationConfig
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::SessionExpirationConfig
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Configures session expiration time. We default to 30 minutes to follow Google Analytics
Instance Attribute Summary collapse
-
#unit ⇒ Object
readonly
Returns the value of attribute unit.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ SessionExpirationConfig
constructor
A new instance of SessionExpirationConfig.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ SessionExpirationConfig
Returns a new instance of SessionExpirationConfig.
47666 47667 47668 47669 47670 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47666 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) @unit = (x = (x = opts.delete(:unit); x.nil? ? "minute" : x); x.is_a?(::Io::Flow::V0::Models::UnitOfTime) ? x : ::Io::Flow::V0::Models::UnitOfTime.apply(x)) @value = HttpClient::Preconditions.assert_class('value', (x = opts.delete(:value); x.nil? ? 30 : x), Integer) end |
Instance Attribute Details
#unit ⇒ Object (readonly)
Returns the value of attribute unit.
47664 47665 47666 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47664 def unit @unit end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
47664 47665 47666 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47664 def value @value end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
47676 47677 47678 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47676 def copy(incoming={}) SessionExpirationConfig.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
47680 47681 47682 47683 47684 47685 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47680 def to_hash { :unit => unit.value, :value => value } end |
#to_json ⇒ Object
47672 47673 47674 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47672 def to_json JSON.dump(to_hash) end |