Class: SSLocal::State

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#environmentObject (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_pathObject



11
12
13
# File 'lib/sslocal/state.rb', line 11

def cert_path
  File.expand_path("config/certificates/#{environment}.crt")
end

#enabled?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/sslocal/state.rb', line 15

def enabled?
  File.exist?(key_path) && File.exist?(cert_path)
end

#key_pathObject



19
20
21
# File 'lib/sslocal/state.rb', line 19

def key_path
  File.expand_path("config/certificates/#{environment}.key")
end