Class: Io::Flow::V0::Models::PaymentMethodDataPaymentOption

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ PaymentMethodDataPaymentOption

Returns a new instance of PaymentMethodDataPaymentOption.



57630
57631
57632
57633
57634
57635
57636
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57630

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id, :name], 'PaymentMethodDataPaymentOption')
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
  @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
  @logo = (x = opts.delete(:logo); x.nil? ? nil : HttpClient::Preconditions.assert_class('logo', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::PaymentMethodDataOptionLogo) ? x : ::Io::Flow::V0::Models::PaymentMethodDataOptionLogo.from_json(x)) })
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



57628
57629
57630
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57628

def id
  @id
end

#logoObject (readonly)

Returns the value of attribute logo.



57628
57629
57630
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57628

def 
  @logo
end

#nameObject (readonly)

Returns the value of attribute name.



57628
57629
57630
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57628

def name
  @name
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



57642
57643
57644
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57642

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

#to_hashObject



57646
57647
57648
57649
57650
57651
57652
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57646

def to_hash
  {
    :id => id,
    :name => name,
    :logo => .nil? ? nil : .map { |o| o.to_hash }
  }
end

#to_jsonObject



57638
57639
57640
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57638

def to_json
  JSON.dump(to_hash)
end