Class: Scale::Types::Hex
Instance Attribute Summary
Attributes included from Base
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Base
#==, included, #initialize, #to_human
Class Method Details
.decode(scale_bytes) ⇒ Object
216 217 218 219 220 221 222 |
# File 'lib/scale/types.rb', line 216 def self.decode(scale_bytes) puts "BEGIN " + self::TYPE_NAME + ": #{scale_bytes}" if Scale::Types.debug == true length = Scale::Types::Compact.decode(scale_bytes).value hex_string = scale_bytes.get_next_bytes(length).bytes_to_hex puts " END " + self::TYPE_NAME + ": #{scale_bytes}" if Scale::Types.debug == true new(hex_string) end |