Class: MilkTea::Types::AttributeHandle

Inherits:
Base
  • Object
show all
Defined in:
lib/milk_tea/core/types/types.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#accept, #bitwise?, #boolean?, #children, #field_c_name, #float?, #integer?, #numeric?, #sendable?, #void?

Constructor Details

#initialize(attribute_name, attribute_module_name, target, params, argument_values) ⇒ AttributeHandle

Returns a new instance of AttributeHandle.



327
328
329
330
331
332
333
334
335
# File 'lib/milk_tea/core/types/types.rb', line 327

def initialize(attribute_name, attribute_module_name, target, params, argument_values)
  @attribute_name = attribute_name
  @attribute_module_name = attribute_module_name
  @target = target
  @params = params.freeze
  @argument_values = argument_values&.freeze
  @hash = [self.class, attribute_module_name, attribute_name, target].hash
  freeze
end

Instance Attribute Details

#argument_valuesObject (readonly)

Returns the value of attribute argument_values.



325
326
327
# File 'lib/milk_tea/core/types/types.rb', line 325

def argument_values
  @argument_values
end

#attribute_module_nameObject (readonly)

Returns the value of attribute attribute_module_name.



325
326
327
# File 'lib/milk_tea/core/types/types.rb', line 325

def attribute_module_name
  @attribute_module_name
end

#attribute_nameObject (readonly)

Returns the value of attribute attribute_name.



325
326
327
# File 'lib/milk_tea/core/types/types.rb', line 325

def attribute_name
  @attribute_name
end

#hashObject (readonly)

Returns the value of attribute hash.



346
347
348
# File 'lib/milk_tea/core/types/types.rb', line 346

def hash
  @hash
end

#paramsObject (readonly)

Returns the value of attribute params.



325
326
327
# File 'lib/milk_tea/core/types/types.rb', line 325

def params
  @params
end

#targetObject (readonly)

Returns the value of attribute target.



325
326
327
# File 'lib/milk_tea/core/types/types.rb', line 325

def target
  @target
end

Instance Method Details

#eql?(other) ⇒ Boolean Also known as: ==

Returns:

  • (Boolean)


337
338
339
340
341
342
# File 'lib/milk_tea/core/types/types.rb', line 337

def eql?(other)
  other.is_a?(AttributeHandle) &&
    other.attribute_name == attribute_name &&
    other.attribute_module_name == attribute_module_name &&
    other.target == target
end

#to_sObject



349
350
351
352
# File 'lib/milk_tea/core/types/types.rb', line 349

def to_s
  qualifier = attribute_module_name ? "#{attribute_module_name}." : ""
  "attribute_of(#{target}, #{qualifier}#{attribute_name})"
end