Module: Pacemaker::Options

Overview

pacemaker options submodule takes the options structure from the YAML file other options sources can be implemented here

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.pacemaker_optionsHash

pacemaker options structure (class level)

Returns:

  • (Hash)


14
15
16
17
# File 'lib/pacemaker/options.rb', line 14

def self.pacemaker_options
  return @pacemaker_options if @pacemaker_options
  @pacemaker_options = YAML.load_file pacemaker_options_file
end

.pacemaker_options_fileString

the YAML file with pacemaker options

Returns:

  • (String)


8
9
10
# File 'lib/pacemaker/options.rb', line 8

def self.pacemaker_options_file
  File.join File.dirname(__FILE__), 'options.yaml'
end

Instance Method Details

#max_wait_timeInteger

maximum possible waiting time of retry functions

Returns:

  • (Integer)


27
28
29
# File 'lib/pacemaker/options.rb', line 27

def max_wait_time
  pacemaker_options[:retry_count] * pacemaker_options[:retry_step]
end

#pacemaker_optionsHash

pacemaker options structure (instance level)

Returns:

  • (Hash)


21
22
23
# File 'lib/pacemaker/options.rb', line 21

def pacemaker_options
  Pacemaker::Options.pacemaker_options
end