Class: Calypso::ParserProxy
- Inherits:
-
Object
- Object
- Calypso::ParserProxy
- Defined in:
- lib/calypso/parserproxy.rb
Overview
Proxy class for the Calypso configuration parser.
Instance Method Summary collapse
-
#hardware ⇒ Hash
Get the available hardware.
-
#initialize(type, file) ⇒ ParserProxy
constructor
Create a new parser proxy instance.
-
#parse ⇒ Object
Parse the config file.
-
#tests ⇒ Hash
Get a hash containing all tests.
Constructor Details
#initialize(type, file) ⇒ ParserProxy
Create a new parser proxy instance.
30 31 32 33 34 35 36 37 38 |
# File 'lib/calypso/parserproxy.rb', line 30 def initialize(type, file) @file = File.(file) @parser = case type when :yaml YAMLParser.new(@file) else nil end end |
Instance Method Details
#hardware ⇒ Hash
Get the available hardware.
48 49 50 |
# File 'lib/calypso/parserproxy.rb', line 48 def hardware @parser.hardware end |
#parse ⇒ Object
Parse the config file.
41 42 43 |
# File 'lib/calypso/parserproxy.rb', line 41 def parse @parser.parse end |
#tests ⇒ Hash
Get a hash containing all tests.
55 56 57 |
# File 'lib/calypso/parserproxy.rb', line 55 def tests @parser.tests end |