Module: Swagger::Parsers

Defined in:
lib/swagger/parsers.rb

Overview

Provides classes for loading Swagger from YAML or JSON.

Defined Under Namespace

Classes: JSONParser, YAMLParser

Class Method Summary collapse

Class Method Details

.parser_for(format) ⇒ Object


7
8
9
10
11
12
13
14
15
16
# File 'lib/swagger/parsers.rb', line 7

def self.parser_for(format)
  case format
  when '.yaml', '.yml', :yaml
    YAMLParser
  when '.json', '.js', :json
    JSONParser
  else
    nil
  end
end