Sha256: 102681b42d96d0cb3a306b1971f6b39a5d2f2cb7e9e404c60310eb02610a908e
Contents?: true
Size: 811 Bytes
Versions: 12
Compression:
Stored size: 811 Bytes
Contents
module OasRails module Spec class PathItem include Specable attr_reader :get, :post, :put, :patch, :delete def initialize(specification) @specification = specification @get = nil @post = nil @put = nil @patch = nil @delete = nil end def fill_from(path, route_extractor: Extractors::RouteExtractor) route_extractor.host_routes_by_path(path).each do |oas_route| add_operation(oas_route.verb.downcase, Spec::Operation.new(@specification).fill_from(oas_route)) end self end def add_operation(http_method, operation) instance_variable_set("@#{http_method}", operation) end def oas_fields [:get, :post, :put, :patch, :delete] end end end end
Version data entries
12 entries across 12 versions & 1 rubygems