Class: Respawn::Environment

Inherits:
Data
  • Object
show all
Defined in:
lib/respawn/environment.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env:) ⇒ Environment



13
14
15
16
17
# File 'lib/respawn/environment.rb', line 13

def initialize(env:)
  ENVIRONMENTS.try!(env)

  super
end

Instance Attribute Details

#envObject (readonly)

Returns the value of attribute env



10
11
12
# File 'lib/respawn/environment.rb', line 10

def env
  @env
end

Class Method Details

.defaultObject



25
26
27
28
29
30
31
# File 'lib/respawn/environment.rb', line 25

def self.default
  new(
    ENV.fetch("RUBY_ENV") do
      ENV.fetch("RAILS_ENV", "production")
    end,
  )
end