Class: Beowulf::Type::PointInTime

Inherits:
Serializer show all
Defined in:
lib/beowulf/type/point_in_time.rb

Instance Method Summary collapse

Methods included from Utils

#debug, #error, #extract_signatures, #hexlify, #pakArr, #pakC, #pakHash, #pakI, #pakL!, #pakPubKey, #pakQ, #pakS, #pakStr, #pakc, #pakq, #paks, #send_log, #unhexlify, #varint, #warning

Constructor Details

#initialize(value) ⇒ PointInTime

Returns a new instance of PointInTime.



4
5
6
# File 'lib/beowulf/type/point_in_time.rb', line 4

def initialize(value)
  super(:point_in_time, value)
end

Instance Method Details

#to_bytesObject



8
9
10
# File 'lib/beowulf/type/point_in_time.rb', line 8

def to_bytes
  [Time.parse(@value + 'Z').to_i].pack('I')
end

#to_sObject



12
13
14
# File 'lib/beowulf/type/point_in_time.rb', line 12

def to_s
  @value
end