Class: Esse::Jbuilder::WithAssigns

Inherits:
Jbuilder
  • Object
show all
Defined in:
lib/esse/jbuilder/template.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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(options = {})
  @__assigns = options.delete(:assigns) || {}
  super(options)
end

Instance Attribute Details

#__assignsObject (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

Raises:

  • (::NotImplementedError)


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