Class: Peggy::Element
- Inherits:
-
Object
- Object
- Peggy::Element
- Defined in:
- lib/builder.rb,
lib/Copy of builder.rb
Overview
Base syntax element class.
Class Method Summary collapse
-
.build(*args) ⇒ Object
Create an element.
Instance Method Summary collapse
-
#match(parser, index) ⇒ Object
Test to see if there is a match of this element at the current index.
- #report(index) ⇒ Object
Class Method Details
.build(*args) ⇒ Object
Create an element.
10 11 12 |
# File 'lib/builder.rb', line 10 def self::build *args new *args end |
Instance Method Details
#match(parser, index) ⇒ Object
Test to see if there is a match of this element at the current index. Return’s the index following if match is found, or NO_MATCH if not
16 17 18 |
# File 'lib/builder.rb', line 16 def match parser, index raise "Must override match" end |
#report(index) ⇒ Object
20 21 22 23 |
# File 'lib/builder.rb', line 20 def report index # puts "#{to_s} #{index}" index end |