Class: Openapi2ruby::Parser
- Inherits:
-
Object
- Object
- Openapi2ruby::Parser
- Defined in:
- lib/openapi2ruby/parser.rb
Class Method Summary collapse
-
.parse(path) ⇒ Openapi2ruby::Openapi
Parse openapi.yaml.
Instance Method Summary collapse
-
#initialize(path) ⇒ Parser
constructor
A new instance of Parser.
-
#parse ⇒ Openapi2ruby::Openapi
Parse openapi.yaml.
- #parse_file ⇒ Object
Constructor Details
#initialize(path) ⇒ Parser
Returns a new instance of Parser.
12 13 14 |
# File 'lib/openapi2ruby/parser.rb', line 12 def initialize(path) @path = path end |
Class Method Details
.parse(path) ⇒ Openapi2ruby::Openapi
Parse openapi.yaml
8 9 10 |
# File 'lib/openapi2ruby/parser.rb', line 8 def self.parse(path) new(path).parse end |
Instance Method Details
#parse ⇒ Openapi2ruby::Openapi
Parse openapi.yaml
18 19 20 |
# File 'lib/openapi2ruby/parser.rb', line 18 def parse Openapi.new(parse_file) end |
#parse_file ⇒ Object
22 23 24 25 |
# File 'lib/openapi2ruby/parser.rb', line 22 def parse_file file = File.read(@path) YAML.load(file) end |