Class: Kudan::Configuration
- Inherits:
-
Object
- Object
- Kudan::Configuration
- Defined in:
- lib/kudan/configuration.rb
Constant Summary collapse
- OPTIONS =
[:enabled, :sleep_seconds, :tries].map(&:freeze).freeze
Instance Attribute Summary collapse
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#sleep_seconds ⇒ Object
Returns the value of attribute sleep_seconds.
-
#tries ⇒ Object
Returns the value of attribute tries.
Instance Method Summary collapse
- #config ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
9 10 11 12 13 |
# File 'lib/kudan/configuration.rb', line 9 def initialize @enabled = true @tries = 2 @sleep_seconds = 1 end |
Instance Attribute Details
#enabled ⇒ Object
Returns the value of attribute enabled.
7 8 9 |
# File 'lib/kudan/configuration.rb', line 7 def enabled @enabled end |
#sleep_seconds ⇒ Object
Returns the value of attribute sleep_seconds.
7 8 9 |
# File 'lib/kudan/configuration.rb', line 7 def sleep_seconds @sleep_seconds end |
#tries ⇒ Object
Returns the value of attribute tries.
7 8 9 |
# File 'lib/kudan/configuration.rb', line 7 def tries @tries end |
Instance Method Details
#config ⇒ Object
15 16 17 |
# File 'lib/kudan/configuration.rb', line 15 def config OPTIONS.map { |e| [e, send(e)] }.to_h end |