Class: Roda::RodaPlugins::Phlex::TypeError

Inherits:
Error
  • Object
show all
Defined in:
lib/roda/plugins/phlex.rb

Overview

Custom TypeError class for Phlex errors.

Constant Summary collapse

MAX_SIZE =
32

Instance Method Summary collapse

Constructor Details

#initialize(obj) ⇒ TypeError

Initializes a TypeError instance.

Parameters:

  • obj (Object)

    The object that caused the error.



38
39
40
41
42
# File 'lib/roda/plugins/phlex.rb', line 38

def initialize(obj)
  content = obj.inspect
  content = content[0, MAX_SIZE] + "" if content.size > MAX_SIZE
  super("Expected a Phlex instance, received #{content}")
end