Class: Melos::Struct::TreeHashInput

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

Constant Summary collapse

STRUCT =
[
  [:node_type, :uint8],
  [:leaf_node,   :select, ->(ctx){ctx[:node_type] == Melos::Constants::NodeType::LEAF},   :class, Melos::Struct::LeafNodeHashInput],
  [:parent_node, :select, ->(ctx){ctx[:node_type] == Melos::Constants::NodeType::PARENT}, :class, Melos::Struct::ParentNodeHashInput],
]

Instance Attribute Summary collapse

Method Summary

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

#leaf_nodeObject (readonly)

Returns the value of attribute leaf_node.



245
246
247
# File 'lib/melos/struct/structs.rb', line 245

def leaf_node
  @leaf_node
end

#node_typeObject (readonly)

Returns the value of attribute node_type.



245
246
247
# File 'lib/melos/struct/structs.rb', line 245

def node_type
  @node_type
end

#parent_nodeObject (readonly)

Returns the value of attribute parent_node.



245
246
247
# File 'lib/melos/struct/structs.rb', line 245

def parent_node
  @parent_node
end