Class: ActionDispatch::Journey::Formatter::MissingRoute
- Inherits:
-
Object
- Object
- ActionDispatch::Journey::Formatter::MissingRoute
- Defined in:
- lib/action_dispatch/journey/formatter.rb
Instance Attribute Summary collapse
-
#constraints ⇒ Object
readonly
Returns the value of attribute constraints.
-
#missing_keys ⇒ Object
readonly
Returns the value of attribute missing_keys.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#routes ⇒ Object
readonly
Returns the value of attribute routes.
-
#unmatched_keys ⇒ Object
readonly
Returns the value of attribute unmatched_keys.
Instance Method Summary collapse
-
#initialize(constraints, missing_keys, unmatched_keys, routes, name) ⇒ MissingRoute
constructor
A new instance of MissingRoute.
- #message ⇒ Object
- #params ⇒ Object
- #path(method_name) ⇒ Object
Constructor Details
#initialize(constraints, missing_keys, unmatched_keys, routes, name) ⇒ MissingRoute
Returns a new instance of MissingRoute.
35 36 37 38 39 40 41 |
# File 'lib/action_dispatch/journey/formatter.rb', line 35 def initialize(constraints, missing_keys, unmatched_keys, routes, name) @constraints = constraints @missing_keys = missing_keys @unmatched_keys = unmatched_keys @routes = routes @name = name end |
Instance Attribute Details
#constraints ⇒ Object (readonly)
Returns the value of attribute constraints.
33 34 35 |
# File 'lib/action_dispatch/journey/formatter.rb', line 33 def constraints @constraints end |
#missing_keys ⇒ Object (readonly)
Returns the value of attribute missing_keys.
33 34 35 |
# File 'lib/action_dispatch/journey/formatter.rb', line 33 def missing_keys @missing_keys end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
33 34 35 |
# File 'lib/action_dispatch/journey/formatter.rb', line 33 def name @name end |
#routes ⇒ Object (readonly)
Returns the value of attribute routes.
33 34 35 |
# File 'lib/action_dispatch/journey/formatter.rb', line 33 def routes @routes end |
#unmatched_keys ⇒ Object (readonly)
Returns the value of attribute unmatched_keys.
33 34 35 |
# File 'lib/action_dispatch/journey/formatter.rb', line 33 def unmatched_keys @unmatched_keys end |
Instance Method Details
#message ⇒ Object
51 52 53 54 55 56 |
# File 'lib/action_dispatch/journey/formatter.rb', line 51 def = +"No route matches #{Hash[constraints.sort_by { |k, v| k.to_s }].inspect}" << ", missing required keys: #{missing_keys.sort.inspect}" if missing_keys && !missing_keys.empty? << ", possible unmatched constraints: #{unmatched_keys.sort.inspect}" if unmatched_keys && !unmatched_keys.empty? end |
#params ⇒ Object
47 48 49 |
# File 'lib/action_dispatch/journey/formatter.rb', line 47 def params path("unknown") end |
#path(method_name) ⇒ Object
43 44 45 |
# File 'lib/action_dispatch/journey/formatter.rb', line 43 def path(method_name) raise ActionController::UrlGenerationError.new(, routes, name, method_name) end |