Class: Rbs2ts::Converter::Types::ClassInstance

Inherits:
ConverterBase show all
Defined in:
lib/rbs2ts/converter/types.rb

Instance Method Summary collapse

Methods inherited from ConverterBase

#initialize

Constructor Details

This class inherits a constructor from Rbs2ts::Converter::Types::ConverterBase

Instance Method Details

#to_tsObject



128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/rbs2ts/converter/types.rb', line 128

def to_ts
  case type.name.to_s
  when 'Array' then
    Types::Array.new(type).to_ts
  when 'String' then
    Types::String.new(type).to_ts
  when 'Numeric', 'Integer', 'Float' then
    Types::Integer.new(type).to_ts
  when 'Bool' then
    Types::Bool.new(type).to_ts
  else
    Converter::Helper.convert_name(type.name.name)
  end
end