Class: SenroUsecaser::Environment

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

Overview

Environment detection

Examples:

SenroUsecaser.env.development?
SenroUsecaser.env.production?

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Environment

: (String) -> void



38
39
40
# File 'lib/senro_usecaser/configuration.rb', line 38

def initialize(name)
  @name = name
end

Instance Attribute Details

#name ⇒ Object (readonly)

: () -> String



43
44
45
# File 'lib/senro_usecaser/configuration.rb', line 43

def name
  @name
end

Instance Method Details

#development? ⇒ Boolean

: () -> bool

Returns:

  • (Boolean)


46
47
48
# File 'lib/senro_usecaser/configuration.rb', line 46

def development?
  @name == "development"
end

#production? ⇒ Boolean

: () -> bool

Returns:

  • (Boolean)


56
57
58
# File 'lib/senro_usecaser/configuration.rb', line 56

def production?
  @name == "production"
end

#test? ⇒ Boolean

: () -> bool

Returns:

  • (Boolean)


51
52
53
# File 'lib/senro_usecaser/configuration.rb', line 51

def test?
  @name == "test"
end

#to_s ⇒ Object

: () -> String



61
62
63
# File 'lib/senro_usecaser/configuration.rb', line 61

def to_s
  @name
end