Method: Origami::Parser#initialize

Defined in:
lib/origami/parser.rb

#initialize(options = {}) ⇒ Parser

:nodoc:



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/origami/parser.rb', line 53

def initialize(options = {}) #:nodoc:
    # Type information for indirect objects.
    @deferred_casts = {}

    #Default options values
    @options =
    {
        verbosity: VERBOSE_INFO, # Verbose level.
        ignore_errors: true,     # Try to keep on parsing when errors occur.
        callback: Proc.new {},   # Callback procedure whenever a structure is read.
        logger: STDERR,          # Where to output parser messages.
        colorize_log: true       # Colorize parser output?
    }

    @options.update(options)
    @logger = @options[:logger]
    @data = nil
end