Class: MilkTea::Types::TypeVar
- Defined in:
- lib/milk_tea/core/types/types.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean (also: #==)
- #hash ⇒ Object
-
#initialize(name) ⇒ TypeVar
constructor
A new instance of TypeVar.
- #to_s ⇒ Object
Methods inherited from Base
#accept, #bitwise?, #boolean?, #children, #field_c_name, #float?, #integer?, #numeric?, #sendable?, #void?
Constructor Details
#initialize(name) ⇒ TypeVar
Returns a new instance of TypeVar.
466 467 468 469 |
# File 'lib/milk_tea/core/types/types.rb', line 466 def initialize(name) @name = name freeze end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
464 465 466 |
# File 'lib/milk_tea/core/types/types.rb', line 464 def name @name end |
Instance Method Details
#eql?(other) ⇒ Boolean Also known as: ==
471 472 473 |
# File 'lib/milk_tea/core/types/types.rb', line 471 def eql?(other) other.is_a?(TypeVar) && other.name == name end |
#hash ⇒ Object
477 478 479 480 |
# File 'lib/milk_tea/core/types/types.rb', line 477 def hash @name.hash end |
#to_s ⇒ Object
483 484 485 |
# File 'lib/milk_tea/core/types/types.rb', line 483 def to_s name end |