Class: Dandy::ViewBuilder
- Inherits:
-
Object
- Object
- Dandy::ViewBuilder
show all
- Defined in:
- lib/dandy/view_builder.rb
Instance Method Summary
collapse
Constructor Details
#initialize(template, container, options) ⇒ ViewBuilder
3
4
5
6
7
8
|
# File 'lib/dandy/view_builder.rb', line 3
def initialize(template, container, options)
@template = template
@container = container
@variables = template.scan(/@[a-z_][a-zA-Z_0-9]*/).uniq
@options = options
end
|
Instance Method Details
#process ⇒ Object
10
11
12
13
14
15
16
17
|
# File 'lib/dandy/view_builder.rb', line 10
def process
@variables.each do |variable|
value = @container.resolve(variable.sub('@', '').to_sym)
instance_variable_set variable, value
end
build
end
|