Class: ExpressTemplates::Markup::Wrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/express_templates/markup/wrapper.rb

Overview

wrap locals and helpers for evaluation during render

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, *args, &block) ⇒ Wrapper

Returns a new instance of Wrapper.



8
9
10
11
12
# File 'lib/express_templates/markup/wrapper.rb', line 8

def initialize(name, *args, &block)
  @name = name
  @args = args
  @block_src = block ? block.source : nil
end

Instance Attribute Details

#argsObject

Returns the value of attribute args.



6
7
8
# File 'lib/express_templates/markup/wrapper.rb', line 6

def args
  @args
end

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/express_templates/markup/wrapper.rb', line 6

def name
  @name
end

Instance Method Details

#childrenObject



23
24
25
# File 'lib/express_templates/markup/wrapper.rb', line 23

def children
  []
end

#compileObject



14
15
16
17
# File 'lib/express_templates/markup/wrapper.rb', line 14

def compile
  # insure nils do not blow up view
  %Q(%Q({{#{_compile}}}))
end

#to_templateObject



19
20
21
# File 'lib/express_templates/markup/wrapper.rb', line 19

def to_template
  _compile
end