Sha256: 62af94de8ee0bd92fc4f69b702cfeef49d26058b582c04a4aca671b0c963f1c1
Contents?: true
Size: 575 Bytes
Versions: 1
Compression:
Stored size: 575 Bytes
Contents
module Fakeit module Openapi class << self def load(src) parse_method = parse_method(src) open(src, &:read) .then(&parse_method) .then(&OpenAPIParser.method(:parse)) .then(&Specification.method(:new)) end private def parse_method(src) case File.extname(src) when '.json' then JSON.method(:parse) when '.yml', '.yaml' then YAML.method(:safe_load) else raise 'Invalid openapi specification file' end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
fakeit-0.2.1 | lib/fakeit/openapi/loader.rb |