Class: Nenv::Environment::Loader
- Inherits:
-
Object
- Object
- Nenv::Environment::Loader
- Defined in:
- lib/nenv/environment/loader.rb
Instance Method Summary collapse
-
#initialize(meth) ⇒ Loader
constructor
A new instance of Loader.
- #load(raw_value, &callback) ⇒ Object
Constructor Details
#initialize(meth) ⇒ Loader
Returns a new instance of Loader.
4 5 6 |
# File 'lib/nenv/environment/loader.rb', line 4 def initialize(meth) @bool = meth.to_s.end_with?('?') end |
Instance Method Details
#load(raw_value, &callback) ⇒ Object
8 9 10 11 |
# File 'lib/nenv/environment/loader.rb', line 8 def load(raw_value, &callback) return callback.call(raw_value) if callback @bool ? _to_bool(raw_value) : raw_value end |