Class: RBI::Parser
- Inherits:
-
Object
- Object
- RBI::Parser
- Defined in:
- lib/rbi/parser.rb
Defined Under Namespace
Classes: HeredocLocationVisitor, SigBuilder, TreeBuilder, Visitor
Class Method Summary collapse
-
.parse_file(path) ⇒ Object
: (String path) -> Tree.
- .parse_files(paths) ⇒ Object
-
.parse_string(string) ⇒ Object
: (String string) -> Tree.
- .parse_strings(strings) ⇒ Object
Instance Method Summary collapse
-
#parse_file(path) ⇒ Object
: (String path) -> Tree.
-
#parse_string(string) ⇒ Object
: (String string) -> Tree.
Class Method Details
.parse_file(path) ⇒ Object
: (String path) -> Tree
57 58 59 |
# File 'lib/rbi/parser.rb', line 57 def parse_file(path) Parser.new.parse_file(path) end |
.parse_files(paths) ⇒ Object
62 63 64 65 |
# File 'lib/rbi/parser.rb', line 62 def parse_files(paths) parser = Parser.new paths.map { |path| parser.parse_file(path) } end |
.parse_string(string) ⇒ Object
: (String string) -> Tree
52 53 54 |
# File 'lib/rbi/parser.rb', line 52 def parse_string(string) Parser.new.parse_string(string) end |
Instance Method Details
#parse_file(path) ⇒ Object
: (String path) -> Tree
80 81 82 |
# File 'lib/rbi/parser.rb', line 80 def parse_file(path) parse(::File.read(path), file: path) end |
#parse_string(string) ⇒ Object
: (String string) -> Tree
75 76 77 |
# File 'lib/rbi/parser.rb', line 75 def parse_string(string) parse(string, file: "-") end |