Class: Io::Flow::V0::Models::ActionSelectPaymentOption
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Present the user with a list of options for the Client to choose from.
Instance Attribute Summary collapse
-
#expires_at ⇒ Object
readonly
Returns the value of attribute expires_at.
-
#option_type ⇒ Object
readonly
Returns the value of attribute option_type.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Attributes inherited from Action
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ActionSelectPaymentOption
constructor
A new instance of ActionSelectPaymentOption.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Action
Constructor Details
#initialize(incoming = {}) ⇒ ActionSelectPaymentOption
Returns a new instance of ActionSelectPaymentOption.
29131 29132 29133 29134 29135 29136 29137 29138 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29131 def initialize(incoming={}) super(:type => Action::Types::ACTION_SELECT_PAYMENT_OPTION) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:options, :option_type], 'ActionSelectPaymentOption') @expires_at = (x = opts.delete(:expires_at); x.nil? ? nil : HttpClient::Preconditions.assert_class('expires_at', HttpClient::Helper.to_date_time_iso8601(x), DateTime)) @options = HttpClient::Preconditions.assert_class('options', opts.delete(:options), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::PaymentMethodDataPaymentOption) ? x : ::Io::Flow::V0::Models::PaymentMethodDataPaymentOption.new(x)) } @option_type = (x = opts.delete(:option_type); x.is_a?(::Io::Flow::V0::Models::PaymentMethodDataOptionType) ? x : ::Io::Flow::V0::Models::PaymentMethodDataOptionType.apply(x)) end |
Instance Attribute Details
#expires_at ⇒ Object (readonly)
Returns the value of attribute expires_at.
29129 29130 29131 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29129 def expires_at @expires_at end |
#option_type ⇒ Object (readonly)
Returns the value of attribute option_type.
29129 29130 29131 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29129 def option_type @option_type end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
29129 29130 29131 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29129 def @options end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
29144 29145 29146 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29144 def copy(incoming={}) ActionSelectPaymentOption.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
29148 29149 29150 29151 29152 29153 29154 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29148 def subtype_to_hash { :expires_at => expires_at, :options => .map { |o| o.to_hash }, :option_type => option_type.value } end |
#to_json ⇒ Object
29140 29141 29142 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29140 def to_json JSON.dump(to_hash) end |