Class: Rage::OpenAPI::Parsers::YAML
- Inherits:
-
Object
- Object
- Rage::OpenAPI::Parsers::YAML
- Defined in:
- lib/rage/openapi/parsers/yaml.rb
Instance Method Summary collapse
-
#initialize ⇒ YAML
constructor
A new instance of YAML.
- #known_definition?(yaml) ⇒ Boolean
- #parse(yaml) ⇒ Object
Constructor Details
#initialize ⇒ YAML
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
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 |