Exception: Fortitude::Errors::BlockPassedToNeedMethod
- Defined in:
- lib/fortitude/errors.rb
Instance Attribute Summary collapse
-
#method_name ⇒ Object
readonly
Returns the value of attribute method_name.
-
#widget ⇒ Object
readonly
Returns the value of attribute widget.
Instance Method Summary collapse
-
#initialize(widget, method_name) ⇒ BlockPassedToNeedMethod
constructor
A new instance of BlockPassedToNeedMethod.
Constructor Details
#initialize(widget, method_name) ⇒ BlockPassedToNeedMethod
Returns a new instance of BlockPassedToNeedMethod.
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/fortitude/errors.rb', line 19 def initialize(, method_name) super(%{You passed a block to a method that's a 'needs' method of a Fortitude widget, #{}. } + %{This can mean you've declared a 'need' with the same name as a Fortitude tag method (e.g., "needs :#{method_name}"), } + %{and think you're calling the method that will generate that tag, when you're actually calling a method } + %{that will ignore the block you passed and just return the value of that 'need'. If that is the case, try } + %{calling the tag with 'tag_' prefixed to it (e.g., 'tag_#{method_name}'), which does the same thing; if not, remove } + %{the block and try again.}) @widget = @method_name = method_name end |
Instance Attribute Details
#method_name ⇒ Object (readonly)
Returns the value of attribute method_name.
17 18 19 |
# File 'lib/fortitude/errors.rb', line 17 def method_name @method_name end |
#widget ⇒ Object (readonly)
Returns the value of attribute widget.
17 18 19 |
# File 'lib/fortitude/errors.rb', line 17 def @widget end |