aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/http/headers.rb
diff options
context:
space:
mode:
authorVijay Dev <vijaydev.cse@gmail.com>2014-05-10 13:44:43 +0000
committerVijay Dev <vijaydev.cse@gmail.com>2014-05-10 13:44:43 +0000
commitffb9db0247084514adc73ae92dfe8d5a3033226b (patch)
tree0fe2fe4f71717c7b35d84708a46bfb26a8a9bd96 /actionpack/lib/action_dispatch/http/headers.rb
parentc247370cae6ce681648b8272bf18562addea2353 (diff)
downloadrails-ffb9db0247084514adc73ae92dfe8d5a3033226b.tar.gz
rails-ffb9db0247084514adc73ae92dfe8d5a3033226b.tar.bz2
rails-ffb9db0247084514adc73ae92dfe8d5a3033226b.zip
copy edits [ci skip]
Diffstat (limited to 'actionpack/lib/action_dispatch/http/headers.rb')
-rw-r--r--actionpack/lib/action_dispatch/http/headers.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/actionpack/lib/action_dispatch/http/headers.rb b/actionpack/lib/action_dispatch/http/headers.rb
index cd133d6b99..dbf3fe51f5 100644
--- a/actionpack/lib/action_dispatch/http/headers.rb
+++ b/actionpack/lib/action_dispatch/http/headers.rb
@@ -28,7 +28,7 @@ module ActionDispatch
@env[env_name(key)]
end
- # Set the given value for the key mapped to @env.
+ # Sets the given value for the key mapped to @env.
def []=(key, value)
@env[env_name(key)] = value
end
@@ -36,12 +36,13 @@ module ActionDispatch
def key?(key); @env.key? key; end
alias :include? :key?
-
# Returns the value for the given key mapped to @env.
- # If the key can’t be found, there are several options:
- # with no other arguments, it will raise an KeyError exception;
- # If the optional code block is specified, then that will be run and its
- # result returned.
+ #
+ # If the key is not found and an optional code block is not provided,
+ # raises a <tt>KeyError</tt> exception.
+ #
+ # If the code block is provided, then it will be run and
+ # its result returned.
def fetch(key, *args, &block)
@env.fetch env_name(key), *args, &block
end
@@ -50,7 +51,6 @@ module ActionDispatch
@env.each(&block)
end
-
# Returns a new Http::Headers instance containing the contents of
# <tt>headers_or_env</tt> and the original instance.
def merge(headers_or_env)
@@ -60,7 +60,7 @@ module ActionDispatch
end
# Adds the contents of <tt>headers_or_env</tt> to original instance
- # entries with duplicate keys are overwritten with the values from
+ # entries; duplicate keys are overwritten with the values from
# <tt>headers_or_env</tt>.
def merge!(headers_or_env)
headers_or_env.each do |key, value|