Class: MilkTea::Types::LiteralTypeArg

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ LiteralTypeArg

Returns a new instance of LiteralTypeArg.



417
418
419
420
421
# File 'lib/milk_tea/core/types/types.rb', line 417

def initialize(value)
  @value = value
  @hash = [self.class, value].hash
  freeze
end

Instance Attribute Details

#hashObject (readonly)

Returns the value of attribute hash.



429
430
431
# File 'lib/milk_tea/core/types/types.rb', line 429

def hash
  @hash
end

#valueObject (readonly)

Returns the value of attribute value.



415
416
417
# File 'lib/milk_tea/core/types/types.rb', line 415

def value
  @value
end

Instance Method Details

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

Returns:

  • (Boolean)


423
424
425
# File 'lib/milk_tea/core/types/types.rb', line 423

def eql?(other)
  other.is_a?(LiteralTypeArg) && other.value == value
end

#to_sObject



431
432
433
# File 'lib/milk_tea/core/types/types.rb', line 431

def to_s
  value.to_s
end