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.



56974
56975
56976
56977
56978
56979
56980
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56974

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.



56972
56973
56974
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56972

def id
  @id
end

#imagesObject (readonly)

Returns the value of attribute images.



56972
56973
56974
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56972

def images
  @images
end

#nameObject (readonly)

Returns the value of attribute name.



56972
56973
56974
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56972

def name
  @name
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



56986
56987
56988
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56986

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

#to_hashObject



56990
56991
56992
56993
56994
56995
56996
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56990

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

#to_jsonObject



56982
56983
56984
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56982

def to_json
  JSON.dump(to_hash)
end