Class: TRuby::IR::IntersectionType
- Defined in:
- lib/t_ruby/ir.rb
Overview
Intersection type (Readable & Writable)
Instance Attribute Summary collapse
-
#types ⇒ Object
Returns the value of attribute types.
Attributes inherited from Node
#location, #metadata, #type_info
Instance Method Summary collapse
-
#initialize(types: [], **opts) ⇒ IntersectionType
constructor
A new instance of IntersectionType.
- #to_rbs ⇒ Object
- #to_trb ⇒ Object
Methods inherited from Node
#accept, #children, #transform
Constructor Details
#initialize(types: [], **opts) ⇒ IntersectionType
586 587 588 589 |
# File 'lib/t_ruby/ir.rb', line 586 def initialize(types: [], **opts) super(**opts) @types = types end |
Instance Attribute Details
#types ⇒ Object
Returns the value of attribute types.
584 585 586 |
# File 'lib/t_ruby/ir.rb', line 584 def types @types end |
Instance Method Details
#to_rbs ⇒ Object
591 592 593 |
# File 'lib/t_ruby/ir.rb', line 591 def to_rbs @types.map(&:to_rbs).join(" & ") end |
#to_trb ⇒ Object
595 596 597 |
# File 'lib/t_ruby/ir.rb', line 595 def to_trb @types.map(&:to_trb).join(" & ") end |