Module: Karper::Unpacker
- Defined in:
- lib/karper/unpacker.rb
Class Method Summary collapse
Class Method Details
.unpack(message_class, input) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/karper/unpacker.rb', line 9 def self.unpack(, input) values = MessagePack.load(input) .members.each.with_index do |name, index| next unless name == :timestamp values[index] = unpack_time(values[index]) end .new(*values) end |
.unpack_time(value) ⇒ Object
5 6 7 |
# File 'lib/karper/unpacker.rb', line 5 def self.unpack_time(value) Time.parse(value) end |