Class: Kaiseki::BasicParser

Inherits:
Object show all
Includes:
Parseable
Defined in:
lib/parser_basic.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Parseable

#&, #action, #and?, #cast, #filter, #list, #merge, #not!, #one_or_more, #optional, #override, #parse, #predicate?, #protect, #repeat, #set, #skip, #tag_error, #tag_result, #to_parseable, #validate, #zero_or_more, #|

Constructor Details

#initialize(expected) ⇒ BasicParser

Returns a new instance of BasicParser.



6
7
8
# File 'lib/parser_basic.rb', line 6

def initialize expected
	@expected = expected
end

Instance Attribute Details

#expectedObject (readonly)

Returns the value of attribute expected.



4
5
6
# File 'lib/parser_basic.rb', line 4

def expected
  @expected
end

Instance Method Details

#eql?(other) ⇒ Boolean Also known as: ==

Returns:

  • (Boolean)


10
11
12
# File 'lib/parser_basic.rb', line 10

def eql? other
	other.is_a?(self.class) and other.expected == @expected
end

#to_sObject



16
17
18
# File 'lib/parser_basic.rb', line 16

def to_s
	@expected.inspect
end