Exception: MightyJSON::IllegalTypeError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/mighty_json/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:) ⇒ IllegalTypeError

Returns a new instance of IllegalTypeError.



23
24
25
# File 'lib/mighty_json/errors.rb', line 23

def initialize(type:)
  @type = type
end

Instance Attribute Details

#typeObject (readonly)

Returns the value of attribute type.



21
22
23
# File 'lib/mighty_json/errors.rb', line 21

def type
  @type
end

Instance Method Details

#to_sObject Also known as: message



27
28
29
# File 'lib/mighty_json/errors.rb', line 27

def to_s
  "#{type} can not be put on toplevel"
end