Class: PkiExpress::Name

Inherits:
Object
  • Object
show all
Defined in:
lib/pki_express/name.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model) ⇒ Name

Returns a new instance of Name.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/pki_express/name.rb', line 10

def initialize(model)
  @country = nil
  @organization = nil
  @organization_unit = nil
  @dn_qualifier = nil
  @state_name = nil
  @common_name = nil
  @serial_number = nil
  @locality = nil
  @title = nil
  @surname = nil
  @given_name = nil
  @initials = nil
  @pseudonym = nil
  @generation_qualifier = nil
  @email_address = nil


  if model
    @country = model.fetch(:country)
    @organization = model.fetch(:organization)
    @organization_unit = model.fetch(:organizationUnit)
    @dn_qualifier = model.fetch(:dnQualifier)
    @state_name = model.fetch(:stateName)
    @common_name = model.fetch(:commonName)
    @serial_number = model.fetch(:serialNumber)
    @locality = model.fetch(:locality)
    @title = model.fetch(:title)
    @surname = model.fetch(:surname)
    @given_name = model.fetch(:givenName)
    @initials = model.fetch(:initials)
    @pseudonym = model.fetch(:pseudonym)
    @generation_qualifier = model.fetch(:generationQualifier)
    @email_address = model.fetch(:emailAddress)
  end
end

Instance Attribute Details

#common_nameObject

Returns the value of attribute common_name.



5
6
7
# File 'lib/pki_express/name.rb', line 5

def common_name
  @common_name
end

#countryObject

Returns the value of attribute country.



5
6
7
# File 'lib/pki_express/name.rb', line 5

def country
  @country
end

#dn_qualifierObject

Returns the value of attribute dn_qualifier.



5
6
7
# File 'lib/pki_express/name.rb', line 5

def dn_qualifier
  @dn_qualifier
end

#email_addressObject

Returns the value of attribute email_address.



5
6
7
# File 'lib/pki_express/name.rb', line 5

def email_address
  @email_address
end

#generation_qualifierObject

Returns the value of attribute generation_qualifier.



5
6
7
# File 'lib/pki_express/name.rb', line 5

def generation_qualifier
  @generation_qualifier
end

#given_nameObject

Returns the value of attribute given_name.



5
6
7
# File 'lib/pki_express/name.rb', line 5

def given_name
  @given_name
end

#initialsObject

Returns the value of attribute initials.



5
6
7
# File 'lib/pki_express/name.rb', line 5

def initials
  @initials
end

#localityObject

Returns the value of attribute locality.



5
6
7
# File 'lib/pki_express/name.rb', line 5

def locality
  @locality
end

#organizationObject

Returns the value of attribute organization.



5
6
7
# File 'lib/pki_express/name.rb', line 5

def organization
  @organization
end

#organization_unitObject

Returns the value of attribute organization_unit.



5
6
7
# File 'lib/pki_express/name.rb', line 5

def organization_unit
  @organization_unit
end

#pseudonymObject

Returns the value of attribute pseudonym.



5
6
7
# File 'lib/pki_express/name.rb', line 5

def pseudonym
  @pseudonym
end

#serial_numberObject

Returns the value of attribute serial_number.



5
6
7
# File 'lib/pki_express/name.rb', line 5

def serial_number
  @serial_number
end

#state_nameObject

Returns the value of attribute state_name.



5
6
7
# File 'lib/pki_express/name.rb', line 5

def state_name
  @state_name
end

#surnameObject

Returns the value of attribute surname.



5
6
7
# File 'lib/pki_express/name.rb', line 5

def surname
  @surname
end

#titleObject

Returns the value of attribute title.



5
6
7
# File 'lib/pki_express/name.rb', line 5

def title
  @title
end