Class: R2OAS::Routing::VerbComponent

Inherits:
BaseComponent show all
Defined in:
lib/r2-oas/routing/components/verb_component.rb

Instance Method Summary collapse

Constructor Details

#initialize(verb) ⇒ VerbComponent

Returns a new instance of VerbComponent.



8
9
10
11
# File 'lib/r2-oas/routing/components/verb_component.rb', line 8

def initialize(verb)
  super()
  @verb = verb
end

Instance Method Details

#verbsObject

e.x.) “” => [“get”] e.x.) “POST” => [“post”] e.x.) “GET|POST” => [“get”,“post”]



16
17
18
# File 'lib/r2-oas/routing/components/verb_component.rb', line 16

def verbs
  (@verb.downcase.presence || 'get').split('|')
end