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.



18
19
20
21
# File 'lib/sisow/issuer.rb', line 18

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

.listObject



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/sisow/issuer.rb', line 5

def self.list
  hash = Sisow::Api::DirectoryRequest.perform

  hash.issuer = [ hash.issuer ] unless hash.issuer.is_a?(Array)

  hash.issuer.map do |issuer|
    new(
      :id => issuer.issuerid,
      :name => issuer.issuername
    )
  end
end