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

Returns a new instance of Owner.



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

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

Instance Attribute Details

#countryObject

Returns the value of attribute country.



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

def country
  @country
end

#csrObject

Returns the value of attribute csr.



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

def csr
  @csr
end

#dns_namesObject (readonly)

Returns the value of attribute dns_names.



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

def dns_names
  @dns_names
end

#emailsObject (readonly)

Returns the value of attribute emails.



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

def emails
  @emails
end

#localityObject

Returns the value of attribute locality.



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

def locality
  @locality
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#orgObject

Returns the value of attribute org.



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

def org
  @org
end

#orgUnitObject

Returns the value of attribute orgUnit.



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

def orgUnit
  @orgUnit
end

#serialObject

Returns the value of attribute serial.



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

def serial
  @serial
end

Instance Method Details

#add_dns_names(dns) ⇒ Object



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

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

#add_email(email) ⇒ Object



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

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

#email=(email) ⇒ Object



44
45
46
# File 'lib/pkernel.rb', line 44

def email=(email)
  @emails << email
end

#from_hash(hash) ⇒ Object



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/pkernel.rb', line 48

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