Class: Marker::Arguments
- Inherits:
-
RecursiveList
- Object
- Treetop::Runtime::SyntaxNode
- ParseNode
- RecursiveList
- Marker::Arguments
- Defined in:
- lib/marker/templates.rb
Instance Method Summary collapse
- #to_arg_list(format, options = {}) ⇒ Object
- #to_html(options = {}) ⇒ Object
- #to_s(options = {}) ⇒ Object
Methods inherited from RecursiveList
Methods inherited from Treetop::Runtime::SyntaxNode
Instance Method Details
#to_arg_list(format, options = {}) ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/marker/templates.rb', line 43 def to_arg_list( format, = {} ) pos_params = [] named_params = {} case format when :html to_a.each do |a| next unless a value = ( a.val ? a.val.to_html() : "" ) if a.name named_params[a.name.to_s()] = value else pos_params << value end end else to_a.each do |a| next unless a value = ( a.val ? a.val.to_s() : "" ) if a.name named_params[a.name.to_s()] = value else pos_params << value end end end [pos_params, named_params] end |
#to_html(options = {}) ⇒ Object
73 74 75 76 77 |
# File 'lib/marker/templates.rb', line 73 def to_html( = {} ) to_a.map { |a| a ? a.to_html() : '' }.join(', ') end |
#to_s(options = {}) ⇒ Object
79 80 81 82 83 |
# File 'lib/marker/templates.rb', line 79 def to_s( = {} ) to_a.map { |a| a ? a.to_s() : '' }.join(', ') end |