Class: Kudan::Configuration

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

Constant Summary collapse

OPTIONS =
[:enabled, :sleep_seconds, :tries].map(&:freeze).freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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

#enabledObject

Returns the value of attribute enabled.



7
8
9
# File 'lib/kudan/configuration.rb', line 7

def enabled
  @enabled
end

#sleep_secondsObject

Returns the value of attribute sleep_seconds.



7
8
9
# File 'lib/kudan/configuration.rb', line 7

def sleep_seconds
  @sleep_seconds
end

#triesObject

Returns the value of attribute tries.



7
8
9
# File 'lib/kudan/configuration.rb', line 7

def tries
  @tries
end

Instance Method Details

#configObject



15
16
17
# File 'lib/kudan/configuration.rb', line 15

def config
  OPTIONS.map { |e| [e,  send(e)] }.to_h
end