Class: Sisow::Issuer

Inherits:
Object
  • Object
show all
Defined in:
lib/sisow/issuer.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Issuer

Returns a new instance of Issuer.



13
14
15
16
# File 'lib/sisow/issuer.rb', line 13

def initialize(attributes = {})
  @id   = attributes[:id]
  @name = attributes[:name]
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/sisow/issuer.rb', line 3

def id
  @id
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/sisow/issuer.rb', line 3

def name
  @name
end

Class Method Details

.find(issuer_id) ⇒ Object



9
10
11
# File 'lib/sisow/issuer.rb', line 9

def self.find(issuer_id)
  list.select { |issuer| issuer.id.to_i == issuer_id.to_i }.first
end

.list(merchant_id: nil, merchant_key: nil) ⇒ Object



5
6
7
# File 'lib/sisow/issuer.rb', line 5

def self.list(merchant_id: nil, merchant_key: nil)
  @list ||= find_all_from_api(merchant_id, merchant_key)
end