Class: Melos::Struct::GroupContext

Inherits:
Base
  • Object
show all
Defined in:
lib/melos/struct/structs.rb

Overview

8.1

Constant Summary collapse

STRUCT =
[
  [:version, :uint16],
  [:cipher_suite, :uint16],
  [:group_id, :vec],
  [:epoch, :uint64],
  [:tree_hash, :vec],
  [:confirmed_transcript_hash, :vec],
  [:extensions, :classes, Melos::Struct::Extension]
]

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Base

#deserialize_select_elem_with_context, #initialize, #raw

Constructor Details

This class inherits a constructor from Melos::Struct::Base

Instance Attribute Details

#cipher_suiteObject (readonly)

Returns the value of attribute cipher_suite.



267
268
269
# File 'lib/melos/struct/structs.rb', line 267

def cipher_suite
  @cipher_suite
end

#confirmed_transcript_hashObject (readonly)

Returns the value of attribute confirmed_transcript_hash.



267
268
269
# File 'lib/melos/struct/structs.rb', line 267

def confirmed_transcript_hash
  @confirmed_transcript_hash
end

#epochObject (readonly)

Returns the value of attribute epoch.



267
268
269
# File 'lib/melos/struct/structs.rb', line 267

def epoch
  @epoch
end

#extensionsObject

Returns the value of attribute extensions.



268
269
270
# File 'lib/melos/struct/structs.rb', line 268

def extensions
  @extensions
end

#group_idObject (readonly)

Returns the value of attribute group_id.



267
268
269
# File 'lib/melos/struct/structs.rb', line 267

def group_id
  @group_id
end

#tree_hashObject (readonly)

Returns the value of attribute tree_hash.



267
268
269
# File 'lib/melos/struct/structs.rb', line 267

def tree_hash
  @tree_hash
end

#versionObject (readonly)

Returns the value of attribute version.



267
268
269
# File 'lib/melos/struct/structs.rb', line 267

def version
  @version
end

Class Method Details

.create(cipher_suite:, group_id:, epoch:, tree_hash:, confirmed_transcript_hash:, extensions:) ⇒ Object



279
280
281
282
283
284
285
286
287
288
289
# File 'lib/melos/struct/structs.rb', line 279

def self.create(cipher_suite:, group_id:, epoch:, tree_hash:, confirmed_transcript_hash:, extensions:)
  new_instance = self.allocate
  new_instance.instance_variable_set(:@version, 1)
  new_instance.instance_variable_set(:@cipher_suite, cipher_suite)
  new_instance.instance_variable_set(:@group_id, group_id)
  new_instance.instance_variable_set(:@epoch, epoch)
  new_instance.instance_variable_set(:@tree_hash, tree_hash)
  new_instance.instance_variable_set(:@confirmed_transcript_hash, confirmed_transcript_hash)
  new_instance.instance_variable_set(:@extensions, extensions)
  new_instance
end