Exception: PigeonHole::TypedJSON::UnsupportedType
- Inherits:
-
ArgumentError
- Object
- ArgumentError
- PigeonHole::TypedJSON::UnsupportedType
- Defined in:
- lib/pigeon_hole/typed_json.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
Instance Method Summary collapse
- #add_index_context(index) ⇒ Object
- #add_key_context(parent_key) ⇒ Object
-
#initialize(key, klass) ⇒ UnsupportedType
constructor
A new instance of UnsupportedType.
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
#key ⇒ Object (readonly)
Returns the value of attribute key.
4 5 6 |
# File 'lib/pigeon_hole/typed_json.rb', line 4 def key @key end |
#klass ⇒ Object (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 |