Exception: Grac::Exception::InvalidContent

Inherits:
StandardError
  • Object
show all
Defined in:
lib/grac/exception.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(body, type) ⇒ InvalidContent

Returns a new instance of InvalidContent.



66
67
68
69
# File 'lib/grac/exception.rb', line 66

def initialize(body, type)
  @body = body
  @type = type
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



64
65
66
# File 'lib/grac/exception.rb', line 64

def body
  @body
end

Instance Method Details

#inspectObject



75
76
77
# File 'lib/grac/exception.rb', line 75

def inspect
  "#{self.class.name}: #{message}"
end

#messageObject Also known as: to_s



71
72
73
# File 'lib/grac/exception.rb', line 71

def message
  "Failed to parse body as '#{@type}': '#{@body}'"
end