aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/journey/route.rb
diff options
context:
space:
mode:
authorFrancesco Rodriguez <lrodriguezsanc@gmail.com>2012-12-20 15:42:39 -0500
committerFrancesco Rodriguez <lrodriguezsanc@gmail.com>2012-12-20 15:42:39 -0500
commiteb493f5ac84f2d65fbd1666e1496f0a8deafa27f (patch)
tree6c8226f652f99648a1898c2cfa33f9aa13041925 /actionpack/lib/action_dispatch/journey/route.rb
parent42b555dcf3d3dfc8c4b56e6bf903389f014bf05e (diff)
downloadrails-eb493f5ac84f2d65fbd1666e1496f0a8deafa27f.tar.gz
rails-eb493f5ac84f2d65fbd1666e1496f0a8deafa27f.tar.bz2
rails-eb493f5ac84f2d65fbd1666e1496f0a8deafa27f.zip
update AD::Journey to follow Rails coding conventions
Diffstat (limited to 'actionpack/lib/action_dispatch/journey/route.rb')
-rw-r--r--actionpack/lib/action_dispatch/journey/route.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/lib/action_dispatch/journey/route.rb b/actionpack/lib/action_dispatch/journey/route.rb
index 2de711f091..d18efd863a 100644
--- a/actionpack/lib/action_dispatch/journey/route.rb
+++ b/actionpack/lib/action_dispatch/journey/route.rb
@@ -11,7 +11,7 @@ module ActionDispatch
##
# +path+ is a path constraint.
# +constraints+ is a hash of constraints to be applied to this route.
- def initialize name, app, path, constraints, defaults = {}
+ def initialize(name, app, path, constraints, defaults = {})
constraints = constraints.dup
@name = name
@app = app
@@ -52,7 +52,7 @@ module ActionDispatch
path.required_names.map { |x| x.to_sym } + required_defaults.keys
end
- def score constraints
+ def score(constraints)
required_keys = path.required_names
supplied_keys = constraints.map { |k,v| v && k.to_s }.compact
@@ -67,7 +67,7 @@ module ActionDispatch
end
alias :segment_keys :parts
- def format path_options
+ def format(path_options)
path_options.delete_if do |key, value|
value.to_s == defaults[key].to_s && !required_parts.include?(key)
end
@@ -86,7 +86,7 @@ module ActionDispatch
def required_defaults
@required_defaults ||= begin
matches = parts
- @defaults.dup.delete_if { |k,_| matches.include? k }
+ @defaults.dup.delete_if { |k,_| matches.include?(k) }
end
end
end