Class: MilkTea::Types::StructHandle
- Defined in:
- lib/milk_tea/core/types/types.rb
Instance Attribute Summary collapse
-
#declaration ⇒ Object
readonly
Returns the value of attribute declaration.
-
#hash ⇒ Object
readonly
Returns the value of attribute hash.
-
#struct_type ⇒ Object
readonly
Returns the value of attribute struct_type.
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean (also: #==)
-
#initialize(struct_type, declaration) ⇒ StructHandle
constructor
A new instance of StructHandle.
- #to_s ⇒ Object
Methods inherited from Base
#accept, #bitwise?, #boolean?, #children, #field_c_name, #float?, #integer?, #numeric?, #sendable?, #void?
Constructor Details
#initialize(struct_type, declaration) ⇒ StructHandle
Returns a new instance of StructHandle.
254 255 256 257 258 259 |
# File 'lib/milk_tea/core/types/types.rb', line 254 def initialize(struct_type, declaration) @struct_type = struct_type @declaration = declaration @hash = [self.class, struct_type].hash freeze end |
Instance Attribute Details
#declaration ⇒ Object (readonly)
Returns the value of attribute declaration.
252 253 254 |
# File 'lib/milk_tea/core/types/types.rb', line 252 def declaration @declaration end |
#hash ⇒ Object (readonly)
Returns the value of attribute hash.
267 268 269 |
# File 'lib/milk_tea/core/types/types.rb', line 267 def hash @hash end |
#struct_type ⇒ Object (readonly)
Returns the value of attribute struct_type.
252 253 254 |
# File 'lib/milk_tea/core/types/types.rb', line 252 def struct_type @struct_type end |
Instance Method Details
#eql?(other) ⇒ Boolean Also known as: ==
261 262 263 |
# File 'lib/milk_tea/core/types/types.rb', line 261 def eql?(other) other.is_a?(StructHandle) && other.struct_type == struct_type end |
#to_s ⇒ Object
270 271 272 |
# File 'lib/milk_tea/core/types/types.rb', line 270 def to_s "field target #{struct_type}" end |