123456789_123456789_123456789_123456789_123456789_

Class: ActionDispatch::Journey::Formatter::MissingRoute

Do not use. This class is for internal use only.
Relationships & Source Files
Inherits: Object
Defined in: actionpack/lib/action_dispatch/journey/formatter.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(constraints, missing_keys, unmatched_keys, routes, name) ⇒ MissingRoute

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/journey/formatter.rb', line 37

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 (readonly)

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/journey/formatter.rb', line 35

attr_reader :routes, :name, :constraints, :missing_keys, :unmatched_keys

#missing_keys (readonly)

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/journey/formatter.rb', line 35

attr_reader :routes, :name, :constraints, :missing_keys, :unmatched_keys

#name (readonly)

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/journey/formatter.rb', line 35

attr_reader :routes, :name, :constraints, :missing_keys, :unmatched_keys

#routes (readonly)

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/journey/formatter.rb', line 35

attr_reader :routes, :name, :constraints, :missing_keys, :unmatched_keys

#unmatched_keys (readonly)

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/journey/formatter.rb', line 35

attr_reader :routes, :name, :constraints, :missing_keys, :unmatched_keys

Instance Method Details

#message

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/journey/formatter.rb', line 53

def message
  message = +"No route matches #{Hash[constraints.sort_by { |k, v| k.to_s }].inspect}"
  message << ", missing required keys: #{missing_keys.sort.inspect}" if missing_keys && !missing_keys.empty?
  message << ", possible unmatched constraints: #{unmatched_keys.sort.inspect}" if unmatched_keys && !unmatched_keys.empty?
  message
end

#params

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/journey/formatter.rb', line 49

def params
  path("unknown")
end

#path(method_name)

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/journey/formatter.rb', line 45

def path(method_name)
  raise ActionController::UrlGenerationError.new(message, routes, name, method_name)
end