Class: Exonum::HashT

Inherits:
Object
  • Object
show all
Defined in:
lib/exonum/types/primitive.rb

Class Method Summary collapse

Class Method Details

.fixed?Boolean

Returns:

  • (Boolean)


231
232
233
# File 'lib/exonum/types/primitive.rb', line 231

def self.fixed?
  true
end

.serialize(value, buffer, from, shift = 0) ⇒ Object



235
236
237
238
239
240
241
# File 'lib/exonum/types/primitive.rb', line 235

def self.serialize value, buffer, from, shift=0
  raise "Expecting #{size} bytes in hex" unless value.is_a?(String) and value.length == size*2
  [value].pack('H*').bytes.each do |byte|
    buffer[from] = byte
    from += 1
  end
end

.sizeObject



227
228
229
# File 'lib/exonum/types/primitive.rb', line 227

def self.size
  32
end