Class: ActionDispatch::Journey::Route::VerbMatchers::Or
- Inherits:
-
Object
- Object
- ActionDispatch::Journey::Route::VerbMatchers::Or
- Defined in:
- lib/action_dispatch/journey/route.rb
Instance Attribute Summary collapse
-
#verb ⇒ Object
readonly
Returns the value of attribute verb.
Instance Method Summary collapse
- #call(req) ⇒ Object
-
#initialize(verbs) ⇒ Or
constructor
A new instance of Or.
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
#verb ⇒ Object (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 |