Module: Paquito::Struct::ClassMethods

Defined in:
lib/paquito/struct.rb

Instance Method Summary collapse

Instance Method Details

#from_pack(packed) ⇒ Object



62
63
64
65
66
67
68
69
70
# File 'lib/paquito/struct.rb', line 62

def from_pack(packed)
  values = extract_packed_values(packed, as_hash: @__kw_init__)

  if @__kw_init__
    new(**values)
  else
    new(*values)
  end
end

#pack_digestObject



72
73
74
# File 'lib/paquito/struct.rb', line 72

def pack_digest
  @pack_digest ||= ::Paquito::Struct.digest(members)
end