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.
43912 43913 43914 43915 43916 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43912 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.
43910 43911 43912 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43910 def unit @unit end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
43910 43911 43912 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43910 def value @value end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
43922 43923 43924 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43922 def copy(incoming={}) SessionExpirationConfig.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
43926 43927 43928 43929 43930 43931 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43926 def to_hash { :unit => unit.value, :value => value } end |
#to_json ⇒ Object
43918 43919 43920 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43918 def to_json JSON.dump(to_hash) end |