Class: Snails::Env

Inherits:
Object show all
Defined in:
runtime/snails/env.rb,
runtime/snails/env.rbs

Overview

a plain object answering the known environment predicates (no method_missing, no String subclass). A name outside the vocabulary answers every predicate false rather than raising — mode is read on the request path (the logger's gate), where a raise would turn a typo into a 500.

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Env

Returns a new instance of Env.

Parameters:



8
# File 'runtime/snails/env.rbs', line 8

def initialize: (String name) -> void

Instance Method Details

#development? ⇒ Boolean

Returns:

  • (Boolean)


10
# File 'runtime/snails/env.rbs', line 10

def development?: () -> bool

#name ⇒ String

the mode name as declared: development, test, staging, production, or the raw out-of-vocabulary value. Log records use it for the deployment environment field.

Returns:



47
# File 'runtime/snails/env.rb', line 47

def name: () -> String

#production? ⇒ Boolean

Returns:

  • (Boolean)


11
# File 'runtime/snails/env.rbs', line 11

def production?: () -> bool

#staging? ⇒ Boolean

Returns:

  • (Boolean)


13
# File 'runtime/snails/env.rbs', line 13

def staging?: () -> bool

#test? ⇒ Boolean

Returns:

  • (Boolean)


12
# File 'runtime/snails/env.rbs', line 12

def test?: () -> bool