Class: Io::Flow::V0::Models::KlarnaPaymentCategory

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

Overview

Options that allow the user to pay with, example Pay over time

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ KlarnaPaymentCategory

Returns a new instance of KlarnaPaymentCategory.



44454
44455
44456
44457
44458
44459
44460
44461
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44454

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id, :name], 'KlarnaPaymentCategory')
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
  @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
  @standard_asset_url = (x = opts.delete(:standard_asset_url); x.nil? ? nil : HttpClient::Preconditions.assert_class('standard_asset_url', x, String))
  @descriptive_asset_url = (x = opts.delete(:descriptive_asset_url); x.nil? ? nil : HttpClient::Preconditions.assert_class('descriptive_asset_url', x, String))
end

Instance Attribute Details

#descriptive_asset_urlObject (readonly)

Returns the value of attribute descriptive_asset_url.



44452
44453
44454
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44452

def descriptive_asset_url
  @descriptive_asset_url
end

#idObject (readonly)

Returns the value of attribute id.



44452
44453
44454
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44452

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



44452
44453
44454
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44452

def name
  @name
end

#standard_asset_urlObject (readonly)

Returns the value of attribute standard_asset_url.



44452
44453
44454
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44452

def standard_asset_url
  @standard_asset_url
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



44467
44468
44469
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44467

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

#to_hashObject



44471
44472
44473
44474
44475
44476
44477
44478
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44471

def to_hash
  {
    :id => id,
    :name => name,
    :standard_asset_url => standard_asset_url,
    :descriptive_asset_url => descriptive_asset_url
  }
end

#to_jsonObject



44463
44464
44465
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44463

def to_json
  JSON.dump(to_hash)
end