Sha256: 6fb9a2ce55c791552d9c63b2cde8948e9a676004a1f880c1bf91f08e9eeff1d6

Contents?: true

Size: 823 Bytes

Versions: 130

Compression:

Stored size: 823 Bytes

Contents

class DummyTimeStamp1
  TYPE = 15

  attr_reader :utime, :usec, :time

  def initialize(utime, usec)
    @utime = utime
    @usec = usec
    @time = Time.at(utime, usec)
  end

  def ==(other)
    self.utime == other.utime && self.usec == other.usec
  end

  def self.type_id
    15
  end

  def self.from_msgpack_ext(data)
    new(*data.unpack('I*'))
  end

  def to_msgpack_ext
    [@utime,@usec].pack('I*')
  end
end

class DummyTimeStamp2
  TYPE = 16

  attr_reader :utime, :usec, :time

  def initialize(utime, usec)
    @utime = utime
    @usec = usec
    @time = Time.at(utime, usec)
  end

  def ==(other)
    self.utime == other.utime && self.usec == other.usec
  end

  def self.deserialize(data)
    new(* data.split(',', 2).map(&:to_i))
  end

  def serialize
    [@utime,@usec].map(&:to_s).join(',')
  end
end

Version data entries

130 entries across 130 versions & 3 rubygems

Version Path
msgpack-1.6.0 spec/exttypes.rb
msgpack-1.5.6 spec/exttypes.rb
msgpack-1.5.5 spec/exttypes.rb
msgpack-1.5.4 spec/exttypes.rb
msgpack-1.5.3 spec/exttypes.rb
msgpack-1.5.2 spec/exttypes.rb
msgpack-1.5.1 spec/exttypes.rb
msgpack-1.5.0 spec/exttypes.rb
msgpack-1.4.5 spec/exttypes.rb
msgpack-1.4.4 spec/exttypes.rb
msgpack-1.4.4.pre1-java spec/exttypes.rb
msgpack-1.4.3 spec/exttypes.rb
msgpack-1.4.3-java spec/exttypes.rb
msgpack-1.4.2-java spec/exttypes.rb
msgpack-1.4.2 spec/exttypes.rb
msgpack-1.4.1-java spec/exttypes.rb
msgpack-1.4.0-java spec/exttypes.rb
msgpack-1.4.0.pre1 spec/exttypes.rb
msgpack-1.3.3-x64-mingw32 spec/exttypes.rb
msgpack-1.3.3-x86-mingw32 spec/exttypes.rb