Class: Calypso::ParserProxy

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

Overview

Proxy class for the Calypso configuration parser.

Instance Method Summary collapse

Constructor Details

#initialize(type, file) ⇒ ParserProxy

Create a new parser proxy instance.

Parameters:

  • type (Symbol)

    Parser type.

  • file (String)

    Path to configuration file.



30
31
32
33
34
35
36
37
38
# File 'lib/calypso/parserproxy.rb', line 30

def initialize(type, file)
  @file = File.expand_path(file)
  @parser = case type
            when :yaml
              YAMLParser.new(@file)
            else
              nil
            end
end

Instance Method Details

#hardwareHash

Get the available hardware.

Returns:

  • (Hash)

    Hash of the available hardware.



48
49
50
# File 'lib/calypso/parserproxy.rb', line 48

def hardware
  @parser.hardware
end

#parseObject

Parse the config file.



41
42
43
# File 'lib/calypso/parserproxy.rb', line 41

def parse
  @parser.parse
end

#testsHash

Get a hash containing all tests.

Returns:

  • (Hash)

    All available unit tests.



55
56
57
# File 'lib/calypso/parserproxy.rb', line 55

def tests
  @parser.tests
end