Class: Yard2rbs::Converter
- Inherits:
-
Object
- Object
- Yard2rbs::Converter
- Defined in:
- lib/yard2rbs/converter.rb
Class Method Summary collapse
Instance Method Summary collapse
- #convert ⇒ String
- #initialize(input_path) ⇒ void constructor
Constructor Details
#initialize(input_path) ⇒ void
23 24 25 26 27 |
# File 'lib/yard2rbs/converter.rb', line 23 def initialize(input_path) @parse_result = Prism.parse_file(input_path) @parse_result.attach_comments! @output = [] end |
Class Method Details
.convert(input_path) ⇒ String
16 17 18 |
# File 'lib/yard2rbs/converter.rb', line 16 def convert(input_path) new(input_path).convert end |
Instance Method Details
#convert ⇒ String
30 31 32 33 34 35 36 37 38 |
# File 'lib/yard2rbs/converter.rb', line 30 def convert @_indent_level = 0 @_superclasses = [] # puts @parse_result.value.inspect process(@parse_result.value) output = @output.join("\n") validate(output) output end |