Class: GrowViral::Keystore::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env) ⇒ Configuration

Returns a new instance of Configuration.



6
7
8
# File 'lib/keystore/configuration.rb', line 6

def initialize(env)
  @env = env
end

Instance Attribute Details

#envObject (readonly)

Returns the value of attribute env.



5
6
7
# File 'lib/keystore/configuration.rb', line 5

def env
  @env
end

Instance Method Details

#hostObject



10
11
12
13
14
15
16
17
18
# File 'lib/keystore/configuration.rb', line 10

def host
  case env.to_sym
  when :test
  when :development
    ENV["GROWVIRAL_KEYSTORE_HOST"] || "http://localhost:3000"
  when :production
    ENV["GROWVIRAL_KEYSTORE_HOST"]
  end
end