Class: Marker::Template

Inherits:
ParseNode show all
Defined in:
lib/marker/templates.rb

Instance Method Summary collapse

Methods inherited from Treetop::Runtime::SyntaxNode

#present?

Instance Method Details

#arg_list(format, options) ⇒ Object



28
29
30
# File 'lib/marker/templates.rb', line 28

def arg_list( format, options )
  ( args ? args.to_arg_list( format, options ) : [[], {}] )
end

#argsObject

:nodoc:



37
38
39
# File 'lib/marker/templates.rb', line 37

def args #:nodoc:
  nil
end

#render(format, options = {}) ⇒ Object



19
20
21
# File 'lib/marker/templates.rb', line 19

def render( format, options = {} )
  Marker.templates.send( target, format, *arg_list( format, options ) )
end

#tObject

– defaults ++



33
34
35
# File 'lib/marker/templates.rb', line 33

def t #:nodoc:
  nil
end

#targetObject



23
24
25
26
# File 'lib/marker/templates.rb', line 23

def target
  # sanitize the string to get a method name
  t.text_value.gsub(/\s/, '_').to_sym
end

#to_html(options = {}) ⇒ Object



11
12
13
# File 'lib/marker/templates.rb', line 11

def to_html( options = {} )
  render( :html, options )
end

#to_s(options = {}) ⇒ Object



15
16
17
# File 'lib/marker/templates.rb', line 15

def to_s( options = {} )
  render( :text, options )
end