Class: Esse::Jbuilder::WithAssigns
- Inherits:
-
Jbuilder
- Object
- Jbuilder
- Esse::Jbuilder::WithAssigns
- Defined in:
- lib/esse/jbuilder/template.rb
Instance Attribute Summary collapse
-
#__assigns ⇒ Object
readonly
Returns the value of attribute __assigns.
Instance Method Summary collapse
- #__assign(key) ⇒ Object
-
#initialize(options = {}) ⇒ WithAssigns
constructor
A new instance of WithAssigns.
- #partial!(view_filename, **assigns) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ WithAssigns
Returns a new instance of WithAssigns.
8 9 10 11 |
# File 'lib/esse/jbuilder/template.rb', line 8 def initialize( = {}) @__assigns = .delete(:assigns) || {} super() end |
Instance Attribute Details
#__assigns ⇒ Object (readonly)
Returns the value of attribute __assigns.
6 7 8 |
# File 'lib/esse/jbuilder/template.rb', line 6 def __assigns @__assigns end |
Instance Method Details
#__assign(key) ⇒ Object
13 14 15 |
# File 'lib/esse/jbuilder/template.rb', line 13 def __assign(key) __assigns[key] end |
#partial!(view_filename, **assigns) ⇒ Object
17 18 19 |
# File 'lib/esse/jbuilder/template.rb', line 17 def partial!(view_filename, **assigns) raise ::NotImplementedError, "Partial rendering is not supported. Consider using Esse::Jbuilder::ViewTemplate.call instead." end |