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.



52705
52706
52707
52708
52709
52710
52711
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52705

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.



52703
52704
52705
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52703

def id
  @id
end

#imagesObject (readonly)

Returns the value of attribute images.



52703
52704
52705
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52703

def images
  @images
end

#nameObject (readonly)

Returns the value of attribute name.



52703
52704
52705
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52703

def name
  @name
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



52717
52718
52719
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52717

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

#to_hashObject



52721
52722
52723
52724
52725
52726
52727
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52721

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

#to_jsonObject



52713
52714
52715
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52713

def to_json
  JSON.dump(to_hash)
end