Class: Marker::Template
- Inherits:
-
ParseNode
- Object
- Treetop::Runtime::SyntaxNode
- ParseNode
- Marker::Template
- Defined in:
- lib/marker/templates.rb
Instance Method Summary collapse
- #arg_list(format, options) ⇒ Object
-
#args ⇒ Object
:nodoc:.
- #render(format, options = {}) ⇒ Object
-
#t ⇒ Object
– defaults ++.
- #target ⇒ Object
- #to_html(options = {}) ⇒ Object
- #to_s(options = {}) ⇒ Object
Methods inherited from Treetop::Runtime::SyntaxNode
Instance Method Details
#arg_list(format, options) ⇒ Object
28 29 30 |
# File 'lib/marker/templates.rb', line 28 def arg_list( format, ) ( args ? args.to_arg_list( format, ) : [[], {}] ) end |
#args ⇒ Object
: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, = {} ) Marker.templates.send( target, format, *arg_list( format, ) ) end |
#t ⇒ Object
– defaults ++
33 34 35 |
# File 'lib/marker/templates.rb', line 33 def t #:nodoc: nil end |
#target ⇒ Object
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( = {} ) render( :html, ) end |
#to_s(options = {}) ⇒ Object
15 16 17 |
# File 'lib/marker/templates.rb', line 15 def to_s( = {} ) render( :text, ) end |