Class: Environment
- Inherits:
-
Object
- Object
- Environment
- Defined in:
- lib/yodel/config/environment.rb
Instance Method Summary collapse
-
#initialize ⇒ Environment
constructor
A new instance of Environment.
- #method_missing(sym, *args) ⇒ Object
Constructor Details
#initialize ⇒ Environment
Returns a new instance of Environment.
2 3 4 |
# File 'lib/yodel/config/environment.rb', line 2 def initialize @env = ENV['YODEL_ENV'] || 'development' end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(sym, *args) ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/yodel/config/environment.rb', line 6 def method_missing(sym, *args) sym = sym.to_s if sym.end_with?('!') @env = sym[0..-2] elsif sym.end_with?('?') @env == sym[0..-2] else super end end |