Class: Fabes::Configuration
Instance Attribute Summary collapse
-
#database ⇒ Object
Returns the value of attribute database.
-
#factor ⇒ Object
Returns the value of attribute factor.
Instance Method Summary collapse
- #bandit_factor(percentage) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #use(options) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
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
#database ⇒ Object
Returns the value of attribute database.
3 4 5 |
# File 'lib/fabes/configuration.rb', line 3 def database @database end |
#factor ⇒ Object
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() @database = [:database] || [:db] rescue @database = nil end |