Module: Qrb::Syntax::Heading

Defined in:
lib/qrb/syntax/heading.rb

Instance Method Summary collapse

Instance Method Details

#attributes(factory) ⇒ Object



5
6
7
# File 'lib/qrb/syntax/heading.rb', line 5

def attributes(factory)
  captures[:attribute].map{|x| x.compile(factory) }
end

#compile(factory) ⇒ Object



9
10
11
# File 'lib/qrb/syntax/heading.rb', line 9

def compile(factory)
  Qrb::Heading.new(attributes(factory))
end

#to_astObject



13
14
15
# File 'lib/qrb/syntax/heading.rb', line 13

def to_ast
  captures[:attribute].map(&:to_ast).unshift(:heading)
end