Class: Avrocado::Deserializer
- Inherits:
-
Object
- Object
- Avrocado::Deserializer
- Defined in:
- lib/avrocado/deserializer.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#schema ⇒ Object
readonly
Returns the value of attribute schema.
Class Method Summary collapse
Instance Method Summary collapse
- #deserialize ⇒ Object
-
#initialize(message, schema = Schema.parse) ⇒ Deserializer
constructor
A new instance of Deserializer.
Constructor Details
#initialize(message, schema = Schema.parse) ⇒ Deserializer
Returns a new instance of Deserializer.
5 6 7 8 |
# File 'lib/avrocado/deserializer.rb', line 5 def initialize(, schema = Schema.parse) @message = @schema = schema end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
3 4 5 |
# File 'lib/avrocado/deserializer.rb', line 3 def @message end |
#schema ⇒ Object (readonly)
Returns the value of attribute schema.
3 4 5 |
# File 'lib/avrocado/deserializer.rb', line 3 def schema @schema end |
Class Method Details
.deserialize(message) ⇒ Object
10 11 12 |
# File 'lib/avrocado/deserializer.rb', line 10 def self.deserialize() new().deserialize end |
Instance Method Details
#deserialize ⇒ Object
14 15 16 |
# File 'lib/avrocado/deserializer.rb', line 14 def deserialize JSON.parse(reader.read(nil, decoder).to_s) end |