Class: Melos::Struct::Proposal

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

Overview

12.1

Constant Summary collapse

STRUCT =
[
  [:proposal_type, :uint16],
  [:add, :select, ->(ctx){ctx[:proposal_type] == Melos::Constants::ProposalType::ADD}, :class, Melos::Struct::Add],
  [:update, :select, ->(ctx){ctx[:proposal_type] == Melos::Constants::ProposalType::UPDATE}, :class, Melos::Struct::Update],
  [:remove, :select, ->(ctx){ctx[:proposal_type] == Melos::Constants::ProposalType::REMOVE}, :class, Melos::Struct::Remove],
  [:psk, :select, ->(ctx){ctx[:proposal_type] == Melos::Constants::ProposalType::PSK}, :class, Melos::Struct::PreSharedKey],
  [:reinit, :select, ->(ctx){ctx[:proposal_type] == Melos::Constants::ProposalType::REINIT}, :class, Melos::Struct::ReInit],
  [:external_init, :select, ->(ctx){ctx[:proposal_type] == Melos::Constants::ProposalType::EXTERNAL_INIT}, :class, Melos::Struct::ExternalInit],
  [:group_context_extensions, :select, ->(ctx){ctx[:proposal_type] == Melos::Constants::ProposalType::GROUP_CONTEXT_EXTENSIONS}, :class, Melos::Struct::GroupContextExtensions],
]

Instance Attribute Summary collapse

Instance 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

#addObject (readonly)

Returns the value of attribute add.



440
441
442
# File 'lib/melos/struct/structs.rb', line 440

def add
  @add
end

#external_initObject (readonly)

Returns the value of attribute external_init.



440
441
442
# File 'lib/melos/struct/structs.rb', line 440

def external_init
  @external_init
end

#group_context_extensionsObject (readonly)

Returns the value of attribute group_context_extensions.



440
441
442
# File 'lib/melos/struct/structs.rb', line 440

def group_context_extensions
  @group_context_extensions
end

#proposal_typeObject (readonly)

Returns the value of attribute proposal_type.



440
441
442
# File 'lib/melos/struct/structs.rb', line 440

def proposal_type
  @proposal_type
end

#pskObject (readonly)

Returns the value of attribute psk.



440
441
442
# File 'lib/melos/struct/structs.rb', line 440

def psk
  @psk
end

#reinitObject (readonly)

Returns the value of attribute reinit.



440
441
442
# File 'lib/melos/struct/structs.rb', line 440

def reinit
  @reinit
end

#removeObject (readonly)

Returns the value of attribute remove.



440
441
442
# File 'lib/melos/struct/structs.rb', line 440

def remove
  @remove
end

#updateObject (readonly)

Returns the value of attribute update.



440
441
442
# File 'lib/melos/struct/structs.rb', line 440

def update
  @update
end

Instance Method Details

#proposal_contentObject



452
453
454
# File 'lib/melos/struct/structs.rb', line 452

def proposal_content
  @add || @update || @remove || @psk || @reinit || @external_init || @group_context_extensions
end