Class: Rage::OpenAPI::Parsers::YAML

Inherits:
Object
  • Object
show all
Defined in:
lib/rage/openapi/parsers/yaml.rb

Instance Method Summary collapse

Constructor Details

#initializeYAML

Returns a new instance of YAML.



4
5
# File 'lib/rage/openapi/parsers/yaml.rb', line 4

def initialize(**)
end

Instance Method Details

#known_definition?(yaml) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
10
# File 'lib/rage/openapi/parsers/yaml.rb', line 7

def known_definition?(yaml)
  object = YAML.safe_load(yaml) rescue nil
  !!object && object.is_a?(Enumerable)
end

#parse(yaml) ⇒ Object



12
13
14
# File 'lib/rage/openapi/parsers/yaml.rb', line 12

def parse(yaml)
  __parse(YAML.safe_load(yaml))
end