Class: Syntax::Sections

Inherits:
Treetop::Runtime::SyntaxNode
  • Object
show all
Defined in:
lib/silicon/routing/syntax/sections.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#catchObject (readonly)

Returns the value of attribute catch.



3
4
5
# File 'lib/silicon/routing/syntax/sections.rb', line 3

def catch
  @catch
end

#nodeObject (readonly)

Returns the value of attribute node.



3
4
5
# File 'lib/silicon/routing/syntax/sections.rb', line 3

def node
  @node
end

Instance Method Details

#parseObject



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/silicon/routing/syntax/sections.rb', line 5

def parse
  elements.each do |element|
    if element.is_a? Node
      @node = element.parse
    end

    if element.is_a? CatchSection
      @catch = element.parse
    end
  end

  self
end