Exception: PigeonHole::TypedJSON::UnsupportedType

Inherits:
ArgumentError
  • Object
show all
Defined in:
lib/pigeon_hole/typed_json.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, klass) ⇒ UnsupportedType

Returns a new instance of UnsupportedType.



7
8
9
10
11
12
# File 'lib/pigeon_hole/typed_json.rb', line 7

def initialize(key, klass)
  @key = key
  @klass = klass

  super("Serialization of #{klass} is not supported - key=#{key}")
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



4
5
6
# File 'lib/pigeon_hole/typed_json.rb', line 4

def key
  @key
end

#klassObject (readonly)

Returns the value of attribute klass.



5
6
7
# File 'lib/pigeon_hole/typed_json.rb', line 5

def klass
  @klass
end

Instance Method Details

#add_index_context(index) ⇒ Object



18
19
20
# File 'lib/pigeon_hole/typed_json.rb', line 18

def add_index_context(index)
  add_context("[#{index}]")
end

#add_key_context(parent_key) ⇒ Object



14
15
16
# File 'lib/pigeon_hole/typed_json.rb', line 14

def add_key_context(parent_key)
  add_context(parent_key)
end