Class | Haml::Helpers::ErrorReturn |
In: |
lib/haml/helpers.rb
|
Parent: | Object |
An object that raises an error when \{to_s} is called. It‘s used to raise an error when the return value of a helper is used when it shouldn‘t be.
@param message [String] The error message to raise when \{to_s} is called
# File lib/haml/helpers.rb, line 17 17: def initialize(message) 18: @message = message 19: end
@return [String] A human-readable string representation
# File lib/haml/helpers.rb, line 29 29: def inspect 30: "Haml::Helpers::ErrorReturn(#{@message.inspect})" 31: end
Raises an error.
@raise [Haml::Error] The error
# File lib/haml/helpers.rb, line 24 24: def to_s 25: raise Haml::Error.new(@message) 26: end