Exception: Fortitude::Errors::NoBlockToYieldTo

Inherits:
Base
  • Object
show all
Defined in:
lib/fortitude/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(widget) ⇒ NoBlockToYieldTo

Returns a new instance of NoBlockToYieldTo


156
157
158
159
160
161
162
163
164
165
166
# File 'lib/fortitude/errors.rb', line 156

def initialize(widget)
  super(%{You're trying to call 'yield' (or 'yield_from_widget', or the Erector-compatibility method 'call_block')
from the widget #{widget}; however, there is nothing to yield to. Fortitude
looks for something to yield to in this order:
  1. A block passed to a yield at render time directly (usually via the 'widget' call);
  2. A block passed to the constructor of the widget;
  3. The layout the widget is being rendered in.
None of these exist here, and so calling 'yield', 'yield_from_widget', or 'call_block' is an
undefined operation.})
  @widget = widget
end

Instance Attribute Details

#widgetObject (readonly)

Returns the value of attribute widget


154
155
156
# File 'lib/fortitude/errors.rb', line 154

def widget
  @widget
end