Class: Haml::Helpers::ErrorReturn
Overview
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.
Instance Method Summary collapse
-
#initialize(message) ⇒ ErrorReturn
constructor
A new instance of ErrorReturn.
-
#inspect ⇒ String
A human-readable string representation.
-
#to_s ⇒ Object
Raises an error.
Constructor Details
#initialize(message) ⇒ ErrorReturn
Returns a new instance of ErrorReturn.
17 18 19 |
# File 'lib/haml/helpers.rb', line 17
def initialize(message)
@message = message
end
|
Instance Method Details
#inspect ⇒ String
Returns A human-readable string representation.
29 30 31 |
# File 'lib/haml/helpers.rb', line 29
def inspect
"Haml::Helpers::ErrorReturn(#{@message.inspect})"
end
|
#to_s ⇒ Object
Raises an error.
24 25 26 |
# File 'lib/haml/helpers.rb', line 24
def to_s
raise Haml::Error.new(@message)
end
|