Class: YAMLConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/hb-runner/yaml_config.rb

Overview

this class DRYs up the yaml processing code for both HBQueue and HBConfig

Direct Known Subclasses

HBConfig, HBQueue

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ YAMLConfig

Returns a new instance of YAMLConfig.



9
10
11
12
# File 'lib/hb-runner/yaml_config.rb', line 9

def initialize options = {} 
  options.each { |k,v| instance_variable_set "@#{k}", v }
  read if @file
end

Instance Attribute Details

#fileObject

Returns the value of attribute file.



7
8
9
# File 'lib/hb-runner/yaml_config.rb', line 7

def file
  @file
end

Instance Method Details

#filenameObject



14
# File 'lib/hb-runner/yaml_config.rb', line 14

def filename() File.expand_path file end

#readObject



16
# File 'lib/hb-runner/yaml_config.rb', line 16

def read() raise 'Override!' end

#to_sObject



17
# File 'lib/hb-runner/yaml_config.rb', line 17

def to_s() raise 'Override!' end