Class: ActionDispatch::Router::MatchResult

Inherits:
Object
  • Object
show all
Defined in:
runtime/action_dispatch/router.rb,
runtime/action_dispatch/router.rbs

Overview

The result of a successful Router.match call: the resolved controller class, action symbol, and captured path parameters. Positional initialize, same rationale as Route.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(controller, action, path_params, req_format = nil) ⇒ MatchResult

Returns a new instance of MatchResult.

Parameters:

  • controller (Class)
  • action (Symbol)
  • path_params (Hash[String, String])
  • req_format (Symbol, nil) (defaults to: nil)


21
# File 'runtime/action_dispatch/router.rbs', line 21

def initialize: (Class controller, Symbol action, Hash[String, String] path_params, ?Symbol? req_format) -> void

Instance Attribute Details

#action ⇒ Symbol (readonly)

Returns:

  • (Symbol)


17
# File 'runtime/action_dispatch/router.rbs', line 17

def action: () -> Symbol

#controller ⇒ Class (readonly)

Returns:

  • (Class)


16
# File 'runtime/action_dispatch/router.rbs', line 16

def controller: () -> Class

#path_params ⇒ Hash[String, String] (readonly)

Returns:



18
# File 'runtime/action_dispatch/router.rbs', line 18

def path_params: () -> Hash[String, String]

#req_format ⇒ Symbol? (readonly)

Returns:

  • (Symbol, nil)


19
# File 'runtime/action_dispatch/router.rbs', line 19

def req_format: () -> Symbol?