Class: Rbs2ts::Converter::Types::Intersection
- Inherits:
-
ConverterBase
- Object
- ConverterBase
- Rbs2ts::Converter::Types::Intersection
- Defined in:
- lib/rbs2ts/converter/types.rb
Instance Method Summary collapse
Methods inherited from ConverterBase
Constructor Details
This class inherits a constructor from Rbs2ts::Converter::Types::ConverterBase
Instance Method Details
#to_ts ⇒ Object
117 118 119 120 121 122 123 124 |
# File 'lib/rbs2ts/converter/types.rb', line 117 def to_ts types_ts = type.types.map { |type| ts = Types::Resolver.to_ts(type) type.is_a?(::RBS::Types::Union) || type.is_a?(::RBS::Types::Optional) ? "(#{ts})" : ts } types_ts.join(' & ') end |