Class: RBI::Parser
- Inherits:
-
Object
show all
- Defined in:
- lib/rbi/parser.rb
Defined Under Namespace
Classes: HeredocLocationVisitor, SigBuilder, TreeBuilder, Visitor
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.parse_file(path) ⇒ Object
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
52
53
54
|
# File 'lib/rbi/parser.rb', line 52
def parse_string(string)
Parser.new.parse_string(string)
end
|
.parse_strings(strings) ⇒ Object
68
69
70
71
|
# File 'lib/rbi/parser.rb', line 68
def parse_strings(strings)
parser = Parser.new
strings.map { |string| parser.parse_string(string) }
end
|
Instance Method Details
#parse_file(path) ⇒ Object
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
75
76
77
|
# File 'lib/rbi/parser.rb', line 75
def parse_string(string)
parse(string, file: "-")
end
|