Class: Io::Flow::V0::Models::BrowseOptinResponses
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::BrowseOptinResponses
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#optin_responses ⇒ Object
readonly
Returns the value of attribute optin_responses.
-
#session_id ⇒ Object
readonly
Returns the value of attribute session_id.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ BrowseOptinResponses
constructor
A new instance of BrowseOptinResponses.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ BrowseOptinResponses
Returns a new instance of BrowseOptinResponses.
22676 22677 22678 22679 22680 22681 22682 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22676 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :session_id, :optin_responses], 'BrowseOptinResponses') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @session_id = HttpClient::Preconditions.assert_class('session_id', opts.delete(:session_id), String) @optin_responses = HttpClient::Preconditions.assert_class('optin_responses', opts.delete(:optin_responses), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::OptinResponse) ? x : ::Io::Flow::V0::Models::OptinResponse.new(x)) } end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
22674 22675 22676 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22674 def id @id end |
#optin_responses ⇒ Object (readonly)
Returns the value of attribute optin_responses.
22674 22675 22676 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22674 def optin_responses @optin_responses end |
#session_id ⇒ Object (readonly)
Returns the value of attribute session_id.
22674 22675 22676 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22674 def session_id @session_id end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
22688 22689 22690 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22688 def copy(incoming={}) BrowseOptinResponses.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
22692 22693 22694 22695 22696 22697 22698 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22692 def to_hash { :id => id, :session_id => session_id, :optin_responses => optin_responses.map { |o| o.to_hash } } end |
#to_json ⇒ Object
22684 22685 22686 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22684 def to_json JSON.dump(to_hash) end |