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.

Methods

inspect   new   to_s  

Public Class methods

@param message [String] The error message to raise when \{to_s} is called

[Source]

    # File lib/haml/helpers.rb, line 17
17:       def initialize(message)
18:         @message = message
19:       end

Public Instance methods

@return [String] A human-readable string representation

[Source]

    # 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

[Source]

    # File lib/haml/helpers.rb, line 24
24:       def to_s
25:         raise Haml::Error.new(@message)
26:       end

[Validate]