Class: Rack::Reqorder::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/reqorder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#environmentObject

Returns the value of attribute environment.



28
29
30
# File 'lib/rack/reqorder.rb', line 28

def environment
  @environment
end

#mongoid_ymlObject

Returns the value of attribute mongoid_yml.



28
29
30
# File 'lib/rack/reqorder.rb', line 28

def mongoid_yml
  @mongoid_yml
end

Instance Method Details

#validate!Object



30
31
32
33
34
35
36
37
38
39
# File 'lib/rack/reqorder.rb', line 30

def validate!
  if mongoid_yml.blank?
    raise 'You need to setup mongoid.yml before using this gem'
  end

  if environment.blank?
    puts 'rack-reqorder: No environment found, assuming development environment'
    self.environment = :development
  end
end