Class: ActionDispatch::Journey::Route::VerbMatchers::Or

Inherits:
Object
  • Object
show all
Defined in:
lib/action_dispatch/journey/route.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(verbs) ⇒ Or

Returns a new instance of Or.



44
45
46
47
# File 'lib/action_dispatch/journey/route.rb', line 44

def initialize(verbs)
  @verbs = verbs
  @verb = @verbs.map(&:verb).join("|")
end

Instance Attribute Details

#verbObject (readonly)

Returns the value of attribute verb.



42
43
44
# File 'lib/action_dispatch/journey/route.rb', line 42

def verb
  @verb
end

Instance Method Details

#call(req) ⇒ Object



49
50
51
# File 'lib/action_dispatch/journey/route.rb', line 49

def call(req)
  @verbs.any? { |v| v.call req }
end