Class: MilkTea::Types::FieldHandle
- Defined in:
- lib/milk_tea/core/types/types.rb
Instance Attribute Summary collapse
-
#field_declaration ⇒ Object
readonly
Returns the value of attribute field_declaration.
-
#field_name ⇒ Object
readonly
Returns the value of attribute field_name.
-
#hash ⇒ Object
readonly
Returns the value of attribute hash.
-
#struct_handle ⇒ Object
readonly
Returns the value of attribute struct_handle.
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean (also: #==)
-
#initialize(struct_handle, field_name, field_declaration) ⇒ FieldHandle
constructor
A new instance of FieldHandle.
- #to_s ⇒ Object
Methods inherited from Base
#accept, #bitwise?, #boolean?, #children, #field_c_name, #float?, #integer?, #numeric?, #sendable?, #void?
Constructor Details
#initialize(struct_handle, field_name, field_declaration) ⇒ FieldHandle
Returns a new instance of FieldHandle.
278 279 280 281 282 283 284 |
# File 'lib/milk_tea/core/types/types.rb', line 278 def initialize(struct_handle, field_name, field_declaration) @struct_handle = struct_handle @field_name = field_name @field_declaration = field_declaration @hash = [self.class, struct_handle, field_name].hash freeze end |
Instance Attribute Details
#field_declaration ⇒ Object (readonly)
Returns the value of attribute field_declaration.
276 277 278 |
# File 'lib/milk_tea/core/types/types.rb', line 276 def field_declaration @field_declaration end |
#field_name ⇒ Object (readonly)
Returns the value of attribute field_name.
276 277 278 |
# File 'lib/milk_tea/core/types/types.rb', line 276 def field_name @field_name end |
#hash ⇒ Object (readonly)
Returns the value of attribute hash.
292 293 294 |
# File 'lib/milk_tea/core/types/types.rb', line 292 def hash @hash end |
#struct_handle ⇒ Object (readonly)
Returns the value of attribute struct_handle.
276 277 278 |
# File 'lib/milk_tea/core/types/types.rb', line 276 def struct_handle @struct_handle end |
Instance Method Details
#eql?(other) ⇒ Boolean Also known as: ==
286 287 288 |
# File 'lib/milk_tea/core/types/types.rb', line 286 def eql?(other) other.is_a?(FieldHandle) && other.struct_handle == struct_handle && other.field_name == field_name end |
#to_s ⇒ Object
295 296 297 |
# File 'lib/milk_tea/core/types/types.rb', line 295 def to_s "field_of(#{struct_handle.struct_type}, #{field_name})" end |