Class: MilkTea::Types::LifetimeRef

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(name) ⇒ LifetimeRef

Returns a new instance of LifetimeRef.



491
492
493
494
# File 'lib/milk_tea/core/types/types.rb', line 491

def initialize(name)
  @name = name
  freeze
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



489
490
491
# File 'lib/milk_tea/core/types/types.rb', line 489

def name
  @name
end

Instance Method Details

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

Returns:

  • (Boolean)


496
497
498
# File 'lib/milk_tea/core/types/types.rb', line 496

def eql?(other)
  other.is_a?(LifetimeRef) && other.name == name
end

#hashObject



502
503
504
# File 'lib/milk_tea/core/types/types.rb', line 502

def hash
  @name.hash
end

#to_sObject



507
508
509
# File 'lib/milk_tea/core/types/types.rb', line 507

def to_s
  name
end