Class: Openapi3Parser::SourceInput::StringParser

Inherits:
Object
  • Object
show all
Defined in:
lib/openapi3_parser/source_input/string_parser.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(input, filename) ⇒ StringParser

Returns a new instance of StringParser.



13
14
15
16
# File 'lib/openapi3_parser/source_input/string_parser.rb', line 13

def initialize(input, filename)
  @input = input
  @filename = filename
end

Class Method Details

.call(input, filename = nil) ⇒ Object



9
10
11
# File 'lib/openapi3_parser/source_input/string_parser.rb', line 9

def self.call(input, filename = nil)
  new(input, filename).call
end

Instance Method Details

#callObject



18
19
20
# File 'lib/openapi3_parser/source_input/string_parser.rb', line 18

def call
  json? ? parse_json : parse_yaml
end