Class: Faraday::BetterRetry::Options

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/faraday/better_retry.rb

Instance Method Summary collapse

Instance Method Details

#[](name) ⇒ Object

define for ruby less than 2.0



33
34
35
# File 'lib/faraday/better_retry.rb', line 33

def [](name)
  @table[name.to_sym]
end

#[]=(name, value) ⇒ Object



37
38
39
# File 'lib/faraday/better_retry.rb', line 37

def []=(name, value)
  modifiable[new_ostruct_member(name)] = value
end

#exceptionsObject



28
29
30
# File 'lib/faraday/better_retry.rb', line 28

def exceptions
  Array(self[:exceptions] ||= [Errno::ETIMEDOUT, 'Timeout::Error', Error::TimeoutError])
end

#intervalObject



24
25
26
# File 'lib/faraday/better_retry.rb', line 24

def interval
  (self[:interval] ||= 0).to_f
end

#maxObject



20
21
22
# File 'lib/faraday/better_retry.rb', line 20

def max
  (self[:max] ||= 2).to_i
end