Class: Io::Flow::V0::Models::PaymentMethodBrand

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 = {}) ⇒ PaymentMethodBrand

Returns a new instance of PaymentMethodBrand.



50601
50602
50603
50604
50605
50606
50607
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50601

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id, :name, :images], 'PaymentMethodBrand')
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
  @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
  @images = (x = opts.delete(:images); x.is_a?(::Io::Flow::V0::Models::PaymentMethodImages) ? x : ::Io::Flow::V0::Models::PaymentMethodImages.new(x))
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



50599
50600
50601
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50599

def id
  @id
end

#imagesObject (readonly)

Returns the value of attribute images.



50599
50600
50601
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50599

def images
  @images
end

#nameObject (readonly)

Returns the value of attribute name.



50599
50600
50601
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50599

def name
  @name
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



50613
50614
50615
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50613

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

#to_hashObject



50617
50618
50619
50620
50621
50622
50623
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50617

def to_hash
  {
    :id => id,
    :name => name,
    :images => images.to_hash
  }
end

#to_jsonObject



50609
50610
50611
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50609

def to_json
  JSON.dump(to_hash)
end