Module: Roda::RodaPlugins::Environments::ClassMethods

Defined in:
lib/roda/plugins/environments.rb

Instance Method Summary collapse

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.



53
54
55
56
57
# File 'lib/roda/plugins/environments.rb', line 53

def configure(*envs)
  if envs.empty? || envs.any?{|s| s == environment}
    yield self
  end
end

#environmentObject

The current environment for the application, which should be stored as a symbol.



61
62
63
# File 'lib/roda/plugins/environments.rb', line 61

def environment
  opts[:environment]
end

#environment=(v) ⇒ Object

Override the environment for the application, instead of using RACK_ENV.



67
68
69
# File 'lib/roda/plugins/environments.rb', line 67

def environment=(v)
  opts[:environment] = v
end