Class: SafeBlock::Configuration

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

Constant Summary collapse

VALUES =
:timeout, :threaded, :rescue_block, :ignore_exception

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



46
47
48
49
50
# File 'lib/safeblock/safeblock.rb', line 46

def initialize
  @timeout = 0
  @threaded = false
  @ignore_exception = false
end

Instance Method Details

#to_hashObject



52
53
54
55
56
57
58
# File 'lib/safeblock/safeblock.rb', line 52

def to_hash
  hash = {}
  VALUES.each do |value|
    hash[value] = self.send(value)
  end
  hash
end