Class: ActsAsCalculator::RenderTemplate
- Inherits:
-
Object
- Object
- ActsAsCalculator::RenderTemplate
- Defined in:
- lib/acts_as_calculator/render_template.rb
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(key: nil, scope: nil, owner: nil, version_number: nil, template: nil, result: nil, results: {}, context: {}) ⇒ RenderTemplate
constructor
A new instance of RenderTemplate.
Constructor Details
#initialize(key: nil, scope: nil, owner: nil, version_number: nil, template: nil, result: nil, results: {}, context: {}) ⇒ RenderTemplate
Returns a new instance of RenderTemplate.
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/acts_as_calculator/render_template.rb', line 9 def initialize(key: nil, scope: nil, owner: nil, version_number: nil, template: nil, result: nil, results: {}, context: {}) @key = key @scope = scope @owner = owner @version_number = version_number @template = template @result = result @results = results @context = context end |
Class Method Details
.call ⇒ Object
5 6 7 |
# File 'lib/acts_as_calculator/render_template.rb', line 5 def self.call(...) new(...).call end |
Instance Method Details
#call ⇒ Object
21 22 23 |
# File 'lib/acts_as_calculator/render_template.rb', line 21 def call RenderLiquid.(source: template.body, assigns:) end |