Module: Roda::RodaPlugins::Environments::ClassMethods
- Defined in:
- lib/roda/plugins/environments.rb
Instance Method Summary collapse
-
#configure(*envs) ⇒ Object
If no environments are given or one of the given environments matches the current environment, yield the receiver to the block.
-
#environment ⇒ Object
The current environment for the application, which should be stored as a symbol.
-
#environment=(v) ⇒ Object
Override the environment for the application, instead of using RACK_ENV.
Instance Method Details
#configure(*envs) ⇒ Object
If no environments are given or one of the given environments matches the current environment, yield the receiver to the block.
50 51 52 53 54 |
# File 'lib/roda/plugins/environments.rb', line 50 def configure(*envs) if envs.empty? || envs.any?{|s| s == environment} yield self end end |
#environment ⇒ Object
The current environment for the application, which should be stored as a symbol.
58 59 60 |
# File 'lib/roda/plugins/environments.rb', line 58 def environment opts[:environment] end |
#environment=(v) ⇒ Object
Override the environment for the application, instead of using RACK_ENV.
64 65 66 |
# File 'lib/roda/plugins/environments.rb', line 64 def environment=(v) opts[:environment] = v end |