Class: ExpressTemplates::Markup::Yielder
- Inherits:
-
Object
- Object
- ExpressTemplates::Markup::Yielder
- Defined in:
- lib/express_templates/markup/yielder.rb
Instance Method Summary collapse
- #compile ⇒ Object
-
#initialize(*args) ⇒ Yielder
constructor
A new instance of Yielder.
- #to_template ⇒ Object
Constructor Details
#initialize(*args) ⇒ Yielder
Returns a new instance of Yielder.
4 5 6 |
# File 'lib/express_templates/markup/yielder.rb', line 4 def initialize(*args) @arg = args.first end |
Instance Method Details
#compile ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/express_templates/markup/yielder.rb', line 8 def compile if @arg "yield(#{@arg.inspect})" # usually a symbol but may be string else "yield" end end |
#to_template ⇒ Object
16 17 18 |
# File 'lib/express_templates/markup/yielder.rb', line 16 def to_template compile end |