Class: Io::Flow::V0::Models::CheckoutOptinResponses
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::CheckoutOptinResponses
- 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.
-
#order_number ⇒ Object
readonly
Returns the value of attribute order_number.
-
#session_id ⇒ Object
readonly
Returns the value of attribute session_id.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ CheckoutOptinResponses
constructor
A new instance of CheckoutOptinResponses.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ CheckoutOptinResponses
Returns a new instance of CheckoutOptinResponses.
21961 21962 21963 21964 21965 21966 21967 21968 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21961 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :order_number, :session_id, :optin_responses], 'CheckoutOptinResponses') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @order_number = HttpClient::Preconditions.assert_class('order_number', opts.delete(:order_number), 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.
21959 21960 21961 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21959 def id @id end |
#optin_responses ⇒ Object (readonly)
Returns the value of attribute optin_responses.
21959 21960 21961 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21959 def optin_responses @optin_responses end |
#order_number ⇒ Object (readonly)
Returns the value of attribute order_number.
21959 21960 21961 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21959 def order_number @order_number end |
#session_id ⇒ Object (readonly)
Returns the value of attribute session_id.
21959 21960 21961 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21959 def session_id @session_id end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
21974 21975 21976 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21974 def copy(incoming={}) CheckoutOptinResponses.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
21978 21979 21980 21981 21982 21983 21984 21985 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21978 def to_hash { :id => id, :order_number => order_number, :session_id => session_id, :optin_responses => optin_responses.map { |o| o.to_hash } } end |
#to_json ⇒ Object
21970 21971 21972 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21970 def to_json JSON.dump(to_hash) end |