Class: Scale::Types::Era

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/scale/types.rb

Instance Attribute Summary

Attributes included from Base

#value

Class Method Summary collapse

Methods included from Base

#==, included, #initialize, #to_human

Class Method Details

.decode(scale_bytes) ⇒ Object



382
383
384
385
386
387
388
389
390
391
392
# File 'lib/scale/types.rb', line 382

def self.decode(scale_bytes)
  puts "BEGIN " + self::TYPE_NAME + ": #{scale_bytes}" if Scale::Types.debug == true
  byte = scale_bytes.get_next_bytes(1).bytes_to_hex
  result = if byte == "0x00"
    new byte
  else
    new byte + scale_bytes.get_next_bytes(1).bytes_to_hex()[2..]
  end
  puts "  END " + self::TYPE_NAME + ": #{scale_bytes}" if Scale::Types.debug == true
  result
end