Class: Io::Flow::V0::Models::PaymentMethodDataSelectedPaymentOption

Inherits:
PaymentMethodData
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Attributes inherited from PaymentMethodData

#type

Instance Method Summary collapse

Methods inherited from PaymentMethodData

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ PaymentMethodDataSelectedPaymentOption

Returns a new instance of PaymentMethodDataSelectedPaymentOption.



57660
57661
57662
57663
57664
57665
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57660

def initialize(incoming={})
  super(:type => PaymentMethodData::Types::PAYMENT_METHOD_DATA_SELECTED_PAYMENT_OPTION)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:option_id], 'PaymentMethodDataSelectedPaymentOption')
  @option_id = HttpClient::Preconditions.assert_class('option_id', opts.delete(:option_id), String)
end

Instance Attribute Details

#option_idObject (readonly)

Returns the value of attribute option_id.



57658
57659
57660
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57658

def option_id
  @option_id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



57671
57672
57673
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57671

def copy(incoming={})
  PaymentMethodDataSelectedPaymentOption.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#subtype_to_hashObject



57675
57676
57677
57678
57679
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57675

def subtype_to_hash
  {
    :option_id => option_id
  }
end

#to_jsonObject



57667
57668
57669
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57667

def to_json
  JSON.dump(to_hash)
end