Class: Io::Flow::V0::Models::Issuer

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

Returns a new instance of Issuer.



28260
28261
28262
28263
28264
28265
28266
28267
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28260

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:iin, :card_brand], 'Issuer')
  @iin = HttpClient::Preconditions.assert_class('iin', opts.delete(:iin), String)
  @card_brand = HttpClient::Preconditions.assert_class('card_brand', opts.delete(:card_brand), String)
  @card_type = (x = opts.delete(:card_type); x.nil? ? nil : HttpClient::Preconditions.assert_class('card_type', x, String))
  @name = (x = opts.delete(:name); x.nil? ? nil : HttpClient::Preconditions.assert_class('name', x, String))
end

Instance Attribute Details

#card_brandObject (readonly)

Returns the value of attribute card_brand.



28258
28259
28260
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28258

def card_brand
  @card_brand
end

#card_typeObject (readonly)

Returns the value of attribute card_type.



28258
28259
28260
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28258

def card_type
  @card_type
end

#iinObject (readonly)

Returns the value of attribute iin.



28258
28259
28260
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28258

def iin
  @iin
end

#nameObject (readonly)

Returns the value of attribute name.



28258
28259
28260
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28258

def name
  @name
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



28273
28274
28275
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28273

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

#to_hashObject



28277
28278
28279
28280
28281
28282
28283
28284
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28277

def to_hash
  {
    :iin => iin,
    :card_brand => card_brand,
    :card_type => card_type,
    :name => name
  }
end

#to_jsonObject



28269
28270
28271
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28269

def to_json
  JSON.dump(to_hash)
end