Class: Fabes::Configuration

Inherits:
Object show all
Defined in:
lib/fabes/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



5
6
7
8
# File 'lib/fabes/configuration.rb', line 5

def initialize
  @database = ENV['FABES_DB_URL'] || ENV['REDISTOGO_URL']
  @factor = 0.1
end

Instance Attribute Details

#databaseObject

Returns the value of attribute database.



3
4
5
# File 'lib/fabes/configuration.rb', line 3

def database
  @database
end

#factorObject

Returns the value of attribute factor.



3
4
5
# File 'lib/fabes/configuration.rb', line 3

def factor
  @factor
end

Instance Method Details

#bandit_factor(percentage) ⇒ Object



16
17
18
# File 'lib/fabes/configuration.rb', line 16

def bandit_factor(percentage)
  @factor = percentage
end

#use(options) ⇒ Object



10
11
12
13
14
# File 'lib/fabes/configuration.rb', line 10

def use(options)
  @database = options[:database] || options [:db]
rescue
  @database = nil
end