Sha256: cff494c70c889b138acdcd52096551222cc697e86bbaa4653862fd9fd178303c

Contents?: true

Size: 413 Bytes

Versions: 12

Compression:

Stored size: 413 Bytes

Contents

# frozen_string_literal: true

require_relative 'base_component'

module R2OAS
  module Routing
    class VerbComponent < BaseComponent
      def initialize(verb)
        super()
        @verb = verb
      end

      # e.x.) "" => ["get"]
      # e.x.) "POST" => ["post"]
      # e.x.) "GET|POST" => ["get","post"]
      def verbs
        (@verb.downcase.presence || 'get').split('|')
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
r2-oas-0.5.0 lib/r2-oas/routing/components/verb_component.rb
r2-oas-0.4.1 lib/r2-oas/routing/components/verb_component.rb
r2-oas-0.4.0 lib/r2-oas/routing/components/verb_component.rb
r2-oas-0.3.4 lib/r2-oas/routing/components/verb_component.rb
r2-oas-0.3.3 lib/r2-oas/routing/components/verb_component.rb
r2-oas-0.3.2 lib/r2-oas/routing/components/verb_component.rb
r2-oas-0.3.1 lib/r2-oas/routing/components/verb_component.rb
r2-oas-0.3.0 lib/r2-oas/routing/components/verb_component.rb
r2-oas-0.2.0 lib/r2-oas/routing/components/verb_component.rb
r2-oas-0.1.3 lib/r2-oas/routing/components/verb_component.rb
r2-oas-0.1.2 lib/r2-oas/routing/components/verb_component.rb
r2-oas-0.1.0 lib/r2-oas/routing/components/verb_component.rb