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

Instance Attribute Details

#envObject (readonly)

Returns the value of attribute env

Returns:

  • (Object)

    the current value of env



4
5
6
# File 'lib/respawn/environment.rb', line 4

def env
  @env
end

Class Method Details

.defaultObject



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

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

Instance Method Details

#other?Boolean

Returns:

  • (Boolean)


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

def other?
  !test?
end

#test?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/respawn/environment.rb', line 5

def test?
  env == "test"
end