class Tilia::VObject::Parser::Parser

Abstract parser.

This class serves as a base-class for the different parsers.

Constants

OPTION_FORGIVING

Turning on this option makes the parser more forgiving.

In the case of the MimeDir parser, this means that the parser will accept slashes and underscores in property names, and it will also attempt to fix Microsoft vCard 2.1's broken line folding.

OPTION_IGNORE_INVALID_LINES

If this option is turned on, any lines we cannot parse will be ignored by the reader.

Public Class Methods

new(input = nil, options = 0) click to toggle source

Creates the parser.

Optionally, it's possible to parse the input stream here.

@param input @param [Fixnum] options Any parser options (OPTION constants).

@return [void]

# File lib/tilia/v_object/parser/parser.rb, line 27
def initialize(input = nil, options = 0)
  self.input = input unless input.nil?
  @options = options
end

Public Instance Methods

input=(_input) click to toggle source

Sets the input data.

@param input

@return [void]

# File lib/tilia/v_object/parser/parser.rb, line 51
def input=(_input)
end
parse(input = nil, options = 0) click to toggle source

This method starts the parsing process.

If the input was not supplied during construction, it's possible to pass it here instead.

If either input or options are not supplied, the defaults will be used.

@param input @param [Fixnum] options

@return [Document]

# File lib/tilia/v_object/parser/parser.rb, line 43
def parse(input = nil, options = 0)
end