File: time.rb

package info (click to toggle)
ruby-msgpack 1.8.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 972 kB
  • sloc: ruby: 4,789; ansic: 4,309; java: 1,809; makefile: 4
file content (22 lines) | stat: -rw-r--r-- 625 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
module MessagePack

  # MessagePack::Time provides packer and unpacker functions for a timestamp type.
  # @example Setup for DefaultFactory
  #   MessagePack::DefaultFactory.register_type(
  #     MessagePack::Timestamp::TYPE,
  #     Time,
  #     packer: MessagePack::Time::Packer,
  #     unpacker: MessagePack::Time::Unpacker
  #   )
  class Time
    # A packer function that packs a Time instance to a MessagePack timestamp.
    Packer = lambda { |payload|
      # ...
    }

    # An unpacker function that unpacks a MessagePack timestamp to a Time instance.
    Unpacker = lambda { |time|
      # ...
    }
  end
end