Class: SSLocal::State
- Inherits:
-
Object
- Object
- SSLocal::State
- Defined in:
- lib/sslocal/state.rb
Instance Attribute Summary collapse
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
Instance Method Summary collapse
- #cert_path ⇒ Object
- #enabled? ⇒ Boolean
-
#initialize(environment) ⇒ State
constructor
A new instance of State.
- #key_path ⇒ Object
Constructor Details
#initialize(environment) ⇒ State
Returns a new instance of State.
7 8 9 |
# File 'lib/sslocal/state.rb', line 7 def initialize(environment) @environment = environment end |
Instance Attribute Details
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
5 6 7 |
# File 'lib/sslocal/state.rb', line 5 def environment @environment end |
Instance Method Details
#cert_path ⇒ Object
11 12 13 |
# File 'lib/sslocal/state.rb', line 11 def cert_path File.("config/certificates/#{environment}.crt") end |
#enabled? ⇒ Boolean
15 16 17 |
# File 'lib/sslocal/state.rb', line 15 def enabled? File.exist?(key_path) && File.exist?(cert_path) end |
#key_path ⇒ Object
19 20 21 |
# File 'lib/sslocal/state.rb', line 19 def key_path File.("config/certificates/#{environment}.key") end |