Method: Onceover::Node#initialize

Defined in:
lib/onceover/node.rb

#initialize(name) ⇒ Node

Returns a new instance of Node.



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/onceover/node.rb', line 12

def initialize(name)
  @name = name
  @beaker_node = nil

  # If we can't find the factset it will fail, so just catch that error and ignore it
  begin
    @fact_set = Onceover::Controlrepo.facts[Onceover::Controlrepo.facts_files.index{|facts_file| File.basename(facts_file,'.json') == name}]
  rescue TypeError
    @fact_set = nil
  end
  @@all << self

end