Module: EISCP::Parser

Defined in:
lib/eiscp/parser.rb,
lib/eiscp/parser/iscp_parser.rb,
lib/eiscp/parser/eiscp_parser.rb,
lib/eiscp/parser/dynamic_value_parser.rb,
lib/eiscp/parser/human_readable_parser.rb

Overview

This module provides an interface to the other parser modules.

Defined Under Namespace

Modules: DynamicValueParser, EISCPParser, HumanReadableParser, ISCPParser Classes: EISCPParserException

Class Method Summary collapse

Class Method Details

.parse(string) ⇒ Object

Passes the string to the proper parser module’s #parse method.



11
12
13
14
15
16
17
18
19
20
# File 'lib/eiscp/parser.rb', line 11

def self.parse(string)
  case string
  when /^ISCP/
    EISCPParser.parse(string)
  when ISCPParser::REGEX
    ISCPParser.parse(string)
  else
    HumanReadableParser.parse(string)
  end
end