Class: Phlex::Sinatra::TypeError

Inherits:
Error
  • Object
show all
Defined in:
lib/phlex-sinatra.rb

Constant Summary collapse

MAX_SIZE =
32

Instance Method Summary collapse

Constructor Details

#initialize(obj) ⇒ TypeError

Returns a new instance of TypeError.



14
15
16
17
18
# File 'lib/phlex-sinatra.rb', line 14

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