Class: Avromatic::IO::UnionDatum
- Inherits:
-
Object
- Object
- Avromatic::IO::UnionDatum
- Defined in:
- lib/avromatic/io/union_datum.rb
Instance Attribute Summary collapse
-
#datum ⇒ Object
readonly
Returns the value of attribute datum.
-
#member_index ⇒ Object
readonly
Returns the value of attribute member_index.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(member_index, datum) ⇒ UnionDatum
constructor
A new instance of UnionDatum.
Constructor Details
#initialize(member_index, datum) ⇒ UnionDatum
Returns a new instance of UnionDatum.
8 9 10 11 |
# File 'lib/avromatic/io/union_datum.rb', line 8 def initialize(member_index, datum) @member_index = member_index @datum = datum end |
Instance Attribute Details
#datum ⇒ Object (readonly)
Returns the value of attribute datum.
6 7 8 |
# File 'lib/avromatic/io/union_datum.rb', line 6 def datum @datum end |
#member_index ⇒ Object (readonly)
Returns the value of attribute member_index.
6 7 8 |
# File 'lib/avromatic/io/union_datum.rb', line 6 def member_index @member_index end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
13 14 15 16 17 |
# File 'lib/avromatic/io/union_datum.rb', line 13 def ==(other) other.is_a?(Avromatic::IO::UnionDatum) && member_index == other.member_index && datum == other.datum end |
#hash ⇒ Object
20 21 22 |
# File 'lib/avromatic/io/union_datum.rb', line 20 def hash 31 * datum.hash + member_index end |