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
Returns a new instance of IntersectionType.
568 569 570 571 |
# File 'lib/t_ruby/ir.rb', line 568 def initialize(types: [], **opts) super(**opts) @types = types end |
Instance Attribute Details
#types ⇒ Object
Returns the value of attribute types.
566 567 568 |
# File 'lib/t_ruby/ir.rb', line 566 def types @types end |
Instance Method Details
#to_rbs ⇒ Object
573 574 575 |
# File 'lib/t_ruby/ir.rb', line 573 def to_rbs @types.map(&:to_rbs).join(" & ") end |
#to_trb ⇒ Object
577 578 579 |
# File 'lib/t_ruby/ir.rb', line 577 def to_trb @types.map(&:to_trb).join(" & ") end |