Class: Entrance::Agent::Certificate

Inherits:
Restful
  • Object
show all
Extended by:
Globalizer
Defined in:
lib/entrance/agent/certificate.rb

Instance Attribute Summary collapse

Attributes included from Globalizer

#current

Attributes inherited from Restful

#id

Instance Method Summary collapse

Methods inherited from Restful

#to_rest

Constructor Details

#initialize(params = {}) ⇒ Certificate

Returns a new instance of Certificate.



10
11
12
13
# File 'lib/entrance/agent/certificate.rb', line 10

def initialize params={}
  super params.merge(load:true)
  update_certificate_file
end

Instance Attribute Details

#certificateObject

Returns the value of attribute certificate.



9
10
11
# File 'lib/entrance/agent/certificate.rb', line 9

def certificate
  @certificate
end

#keyObject

Returns the value of attribute key.



9
10
11
# File 'lib/entrance/agent/certificate.rb', line 9

def key
  @key
end

#nameObject

Returns the value of attribute name.



9
10
11
# File 'lib/entrance/agent/certificate.rb', line 9

def name
  @name
end

Instance Method Details

#pathObject



14
15
16
# File 'lib/entrance/agent/certificate.rb', line 14

def path
  @path ||= Config.current.workdir.join("#{@name}.pem").to_s
end

#path=(path) ⇒ Object



17
18
19
# File 'lib/entrance/agent/certificate.rb', line 17

def path=path
  @path = path
end

#to_sObject



20
21
22
23
# File 'lib/entrance/agent/certificate.rb', line 20

def to_s
  update_certificate_file
  @path
end