Class: Parser::OutputFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/kuniri/parser/output_factory.rb

Overview

Simple factory to create output objects.

Instance Method Summary collapse

Instance Method Details

#get_output(pType) ⇒ Object

Handling the output tyoe.

Parameters:

  • pType (String)

    Type of object

Returns:

  • Return an object of output.



14
15
16
17
18
19
20
21
22
23
# File 'lib/kuniri/parser/output_factory.rb', line 14

def get_output(pType)
  pType.downcase!

  if pType == "xml"
    return XMLOutputFormat.new
  end
  if pType == "yml"
    raise Error::ParserError
  end
end