Class: Snails::Env
- 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
- #development? ⇒ Boolean
-
#initialize(name) ⇒ Env
constructor
A new instance of Env.
-
#name ⇒ String
the mode name as declared: development, test, staging, production, or the raw out-of-vocabulary value.
- #production? ⇒ Boolean
- #staging? ⇒ Boolean
- #test? ⇒ Boolean
Constructor Details
#initialize(name) ⇒ Env
Returns a new instance of Env.
8 |
# File 'runtime/snails/env.rbs', line 8
def initialize: (String name) -> void
|
Instance Method Details
#development? ⇒ 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.
47 |
# File 'runtime/snails/env.rb', line 47
def name: () -> String
|
#production? ⇒ Boolean
11 |
# File 'runtime/snails/env.rbs', line 11
def production?: () -> bool
|
#staging? ⇒ Boolean
13 |
# File 'runtime/snails/env.rbs', line 13
def staging?: () -> bool
|
#test? ⇒ Boolean
12 |
# File 'runtime/snails/env.rbs', line 12
def test?: () -> bool
|