Class: Scale::Types::MetadataV0Event

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/metadata/metadata_v0.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



83
84
85
86
87
88
# File 'lib/metadata/metadata_v0.rb', line 83

def self.decode(scale_bytes)
  name = Bytes.decode(scale_bytes).value
  args = Scale::Types.get("Vec<Bytes>").decode(scale_bytes).value.map(&:value)
  documentation = Scale::Types.get("Vec<Bytes>").decode(scale_bytes).value.map(&:value)
  MetadataV0Event.new({name: name, args: args.map {|arg| arg }, documentation: documentation})
end