提交 dd5b083f 编写于 作者: R Ronak Jangir

Renamed ‘Return’ to ‘Returns’ [ci skip]

上级 6474c53d
...@@ -540,7 +540,7 @@ def reject!(&block) ...@@ -540,7 +540,7 @@ def reject!(&block)
end end
alias_method :delete_if, :reject! alias_method :delete_if, :reject!
# Return values that were assigned to the given +keys+. Note that all the # Returns values that were assigned to the given +keys+. Note that all the
# +Hash+ objects will be converted to <tt>ActionController::Parameters</tt>. # +Hash+ objects will be converted to <tt>ActionController::Parameters</tt>.
def values_at(*keys) def values_at(*keys)
convert_value_to_parameters(@parameters.values_at(*keys)) convert_value_to_parameters(@parameters.values_at(*keys))
......
...@@ -30,12 +30,12 @@ def initialize ...@@ -30,12 +30,12 @@ def initialize
@filtered_path = nil @filtered_path = nil
end end
# Return a hash of parameters with all sensitive data replaced. # Returns a hash of parameters with all sensitive data replaced.
def filtered_parameters def filtered_parameters
@filtered_parameters ||= parameter_filter.filter(parameters) @filtered_parameters ||= parameter_filter.filter(parameters)
end end
# Return a hash of request.env with all sensitive data replaced. # Returns a hash of request.env with all sensitive data replaced.
def filtered_env def filtered_env
@filtered_env ||= env_filter.filter(@env) @filtered_env ||= env_filter.filter(@env)
end end
......
...@@ -135,7 +135,7 @@ def end_of_quarter ...@@ -135,7 +135,7 @@ def end_of_quarter
end end
alias :at_end_of_quarter :end_of_quarter alias :at_end_of_quarter :end_of_quarter
# Return a new date/time at the beginning of the year. # Returns a new date/time at the beginning of the year.
# #
# today = Date.today # => Fri, 10 Jul 2015 # today = Date.today # => Fri, 10 Jul 2015
# today.beginning_of_year # => Thu, 01 Jan 2015 # today.beginning_of_year # => Thu, 01 Jan 2015
......
...@@ -16,7 +16,7 @@ def ===(other) ...@@ -16,7 +16,7 @@ def ===(other)
super || (self == Time && other.is_a?(ActiveSupport::TimeWithZone)) super || (self == Time && other.is_a?(ActiveSupport::TimeWithZone))
end end
# Return the number of days in the given month. # Returns the number of days in the given month.
# If no year is specified, it will use the current year. # If no year is specified, it will use the current year.
def days_in_month(month, year = now.year) def days_in_month(month, year = now.year)
if month == 2 && ::Date.gregorian_leap?(year) if month == 2 && ::Date.gregorian_leap?(year)
......
...@@ -384,7 +384,7 @@ def now ...@@ -384,7 +384,7 @@ def now
time_now.utc.in_time_zone(self) time_now.utc.in_time_zone(self)
end end
# Return the current date in this time zone. # Returns the current date in this time zone.
def today def today
tzinfo.now.to_date tzinfo.now.to_date
end end
......
...@@ -170,7 +170,7 @@ def reload_routes! ...@@ -170,7 +170,7 @@ def reload_routes!
routes_reloader.reload! routes_reloader.reload!
end end
# Return the application's KeyGenerator # Returns the application's KeyGenerator
def key_generator def key_generator
# number of iterations selected based on consultation with the google security # number of iterations selected based on consultation with the google security
# team. Details at https://github.com/rails/rails/pull/6952#issuecomment-7661220 # team. Details at https://github.com/rails/rails/pull/6952#issuecomment-7661220
......
...@@ -302,13 +302,13 @@ def self.default_value_for_option(name, options) ...@@ -302,13 +302,13 @@ def self.default_value_for_option(name, options)
default_for_option(Rails::Generators.options, name, options, options[:default]) default_for_option(Rails::Generators.options, name, options, options[:default])
end end
# Return default aliases for the option name given doing a lookup in # Returns default aliases for the option name given doing a lookup in
# Rails::Generators.aliases. # Rails::Generators.aliases.
def self.default_aliases_for_option(name, options) def self.default_aliases_for_option(name, options)
default_for_option(Rails::Generators.aliases, name, options, options[:aliases]) default_for_option(Rails::Generators.aliases, name, options, options[:aliases])
end end
# Return default for the option name given doing a lookup in config. # Returns default for the option name given doing a lookup in config.
def self.default_for_option(config, name, options, default) def self.default_for_option(config, name, options, default)
if generator_name and c = config[generator_name.to_sym] and c.key?(name) if generator_name and c = config[generator_name.to_sym] and c.key?(name)
c[name] c[name]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册