Sha256: 0543c58e9be03184100b00bb8abfed5f9fb1d2ace1cfcf28c8230c8eebda841d

Contents?: true

Size: 1.17 KB

Versions: 27

Compression:

Stored size: 1.17 KB

Contents

module MessagePack
  # A utility class for MessagePack timestamp type
  class Timestamp
    #
    # The timestamp extension type defined in the MessagePack spec.
    #
    # See https://github.com/msgpack/msgpack/blob/master/spec.md#timestamp-extension-type for details.
    #
    TYPE = -1

    # @return [Integer] Second part of the timestamp.
    attr_reader :sec

    # @return [Integer] Nanosecond part of the timestamp.
    attr_reader :nsec

    # @param [Integer] sec
    # @param [Integer] nsec
    def initialize(sec, nsec)
    end

    # @example An unpacker implementation for the Time class
    #   lambda do |payload|
    #     tv = MessagePack::Timestamp.from_msgpack_ext(payload)
    #     Time.at(tv.sec, tv.nsec, :nanosecond)
    #   end
    #
    # @param [String] data
    # @return [MessagePack::Timestamp]
    def self.from_msgpack_ext(data)
    end

    # @example A packer implementation for the Time class
    #   unpacker = lambda do |time|
    #     MessagePack::Timestamp.to_msgpack_ext(time.tv_sec, time.tv_nsec)
    #   end
    #
    # @param [Integer] sec
    # @param [Integer] nsec
    # @return [String]
    def self.to_msgpack_ext(sec, nsec)
    end
  end
end

Version data entries

27 entries across 27 versions & 2 rubygems

Version Path
msgpack-1.6.0 doclib/msgpack/timestamp.rb
msgpack-1.5.6 doclib/msgpack/timestamp.rb
msgpack-1.5.5 doclib/msgpack/timestamp.rb
msgpack-1.5.4 doclib/msgpack/timestamp.rb
msgpack-1.5.3 doclib/msgpack/timestamp.rb
msgpack-1.5.2 doclib/msgpack/timestamp.rb
msgpack-1.5.1 doclib/msgpack/timestamp.rb
msgpack-1.5.0 doclib/msgpack/timestamp.rb
msgpack-1.4.5 doclib/msgpack/timestamp.rb
msgpack-1.4.4 doclib/msgpack/timestamp.rb
msgpack-1.4.3 doclib/msgpack/timestamp.rb
msgpack-1.4.2 doclib/msgpack/timestamp.rb
msgpack-1.4.0.pre1 doclib/msgpack/timestamp.rb
msgpack-1.3.3-x64-mingw32 doclib/msgpack/timestamp.rb
msgpack-1.3.3-x86-mingw32 doclib/msgpack/timestamp.rb
msgpack-1.3.3 doclib/msgpack/timestamp.rb
msgpack-1.3.2-x64-mingw32 doclib/msgpack/timestamp.rb
msgpack-1.3.2-x86-mingw32 doclib/msgpack/timestamp.rb
msgpack-1.3.2 doclib/msgpack/timestamp.rb
chatops-rpc-0.0.2 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/msgpack-1.3.1/doclib/msgpack/timestamp.rb