Class: Scale::Types::Era
Instance Attribute Summary
Attributes included from Base
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 |