Class: Pkernel::Certificate::Owner

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeOwner



30
31
32
33
# File 'lib/pkernel.rb', line 30

def initialize
  @emails = []
  @dns_names = []
end

Instance Attribute Details

#countryObject

Returns the value of attribute country.



27
28
29
# File 'lib/pkernel.rb', line 27

def country
  @country
end

#csrObject

Returns the value of attribute csr.



27
28
29
# File 'lib/pkernel.rb', line 27

def csr
  @csr
end

#dns_namesObject (readonly)

Returns the value of attribute dns_names.



28
29
30
# File 'lib/pkernel.rb', line 28

def dns_names
  @dns_names
end

#emailsObject (readonly)

Returns the value of attribute emails.



28
29
30
# File 'lib/pkernel.rb', line 28

def emails
  @emails
end

#localityObject

Returns the value of attribute locality.



27
28
29
# File 'lib/pkernel.rb', line 27

def locality
  @locality
end

#nameObject

Returns the value of attribute name.



27
28
29
# File 'lib/pkernel.rb', line 27

def name
  @name
end

#orgObject

Returns the value of attribute org.



27
28
29
# File 'lib/pkernel.rb', line 27

def org
  @org
end

#orgUnitObject

Returns the value of attribute orgUnit.



27
28
29
# File 'lib/pkernel.rb', line 27

def orgUnit
  @orgUnit
end

#serialObject

Returns the value of attribute serial.



27
28
29
# File 'lib/pkernel.rb', line 27

def serial
  @serial
end

Instance Method Details

#add_dns_names(dns) ⇒ Object



39
40
41
# File 'lib/pkernel.rb', line 39

def add_dns_names(dns)
  @dns_names << dns if not dns.nil? and not dns.empty?
end

#add_email(email) ⇒ Object



35
36
37
# File 'lib/pkernel.rb', line 35

def add_email(email)
  @emails << email if not email.nil? and not email.empty?
end

#from_hash(hash) ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/pkernel.rb', line 43

def from_hash(hash)
  if not hash.nil?
    hash.each do |k,v|
      case k.downcase.to_sym
      when :name
        @name = v
      when :email
        add_email(v)
      when :country, :c
        @country = v
      when :org
        @org = v
      when :orgUnit, :org_unit
        @orgUnit = v
      end
    end
  end
end