提交 b232c514 编写于 作者: A Akira Matsuda

No need to nodoc private methods

上级 91fa2b71
...@@ -215,7 +215,7 @@ def cache_fragment_name(name = {}, skip_digest: nil, virtual_path: nil) ...@@ -215,7 +215,7 @@ def cache_fragment_name(name = {}, skip_digest: nil, virtual_path: nil)
private private
def fragment_name_with_digest(name, virtual_path) #:nodoc: def fragment_name_with_digest(name, virtual_path)
virtual_path ||= @virtual_path virtual_path ||= @virtual_path
if virtual_path if virtual_path
name = controller.url_for(name).split("://").last if name.is_a?(Hash) name = controller.url_for(name).split("://").last if name.is_a?(Hash)
...@@ -226,7 +226,7 @@ def fragment_name_with_digest(name, virtual_path) #:nodoc: ...@@ -226,7 +226,7 @@ def fragment_name_with_digest(name, virtual_path) #:nodoc:
end end
end end
def fragment_for(name = {}, options = nil, &block) #:nodoc: def fragment_for(name = {}, options = nil, &block)
if content = read_fragment_for(name, options) if content = read_fragment_for(name, options)
@cache_hit = true @cache_hit = true
content content
...@@ -236,11 +236,11 @@ def fragment_for(name = {}, options = nil, &block) #:nodoc: ...@@ -236,11 +236,11 @@ def fragment_for(name = {}, options = nil, &block) #:nodoc:
end end
end end
def read_fragment_for(name, options) #:nodoc: def read_fragment_for(name, options)
controller.read_fragment(name, options) controller.read_fragment(name, options)
end end
def write_fragment_for(name, options) #:nodoc: def write_fragment_for(name, options)
# VIEW TODO: Make #capture usable outside of ERB # VIEW TODO: Make #capture usable outside of ERB
# This dance is needed because Builder can't use capture # This dance is needed because Builder can't use capture
pos = output_buffer.length pos = output_buffer.length
......
...@@ -24,7 +24,7 @@ def render_component(builder) ...@@ -24,7 +24,7 @@ def render_component(builder)
builder.check_box + builder.label builder.check_box + builder.label
end end
def hidden_field_name #:nodoc: def hidden_field_name
"#{super}[]" "#{super}[]"
end end
end end
......
...@@ -43,7 +43,7 @@ def instantiate_builder(builder_class, item, value, text, html_options) ...@@ -43,7 +43,7 @@ def instantiate_builder(builder_class, item, value, text, html_options)
# Generate default options for collection helpers, such as :checked and # Generate default options for collection helpers, such as :checked and
# :disabled. # :disabled.
def default_html_options_for_collection(item, value) #:nodoc: def default_html_options_for_collection(item, value)
html_options = @html_options.dup html_options = @html_options.dup
[:checked, :selected, :disabled, :readonly].each do |option| [:checked, :selected, :disabled, :readonly].each do |option|
...@@ -67,11 +67,11 @@ def default_html_options_for_collection(item, value) #:nodoc: ...@@ -67,11 +67,11 @@ def default_html_options_for_collection(item, value) #:nodoc:
html_options html_options
end end
def sanitize_attribute_name(value) #:nodoc: def sanitize_attribute_name(value)
"#{sanitized_method_name}_#{sanitized_value(value)}" "#{sanitized_method_name}_#{sanitized_value(value)}"
end end
def render_collection #:nodoc: def render_collection
@collection.map do |item| @collection.map do |item|
value = value_for_collection(item, @value_method) value = value_for_collection(item, @value_method)
text = value_for_collection(item, @text_method) text = value_for_collection(item, @text_method)
...@@ -82,7 +82,7 @@ def render_collection #:nodoc: ...@@ -82,7 +82,7 @@ def render_collection #:nodoc:
end.join.html_safe end.join.html_safe
end end
def render_collection_for(builder_class, &block) #:nodoc: def render_collection_for(builder_class, &block)
options = @options.stringify_keys options = @options.stringify_keys
rendered_collection = render_collection do |item, value, text, default_html_options| rendered_collection = render_collection do |item, value, text, default_html_options|
builder = instantiate_builder(builder_class, item, value, text, default_html_options) builder = instantiate_builder(builder_class, item, value, text, default_html_options)
...@@ -103,12 +103,12 @@ def render_collection_for(builder_class, &block) #:nodoc: ...@@ -103,12 +103,12 @@ def render_collection_for(builder_class, &block) #:nodoc:
end end
end end
def hidden_field #:nodoc: def hidden_field
hidden_name = @html_options[:name] || hidden_field_name hidden_name = @html_options[:name] || hidden_field_name
@template_object.hidden_field_tag(hidden_name, "", id: nil) @template_object.hidden_field_tag(hidden_name, "", id: nil)
end end
def hidden_field_name #:nodoc: def hidden_field_name
"#{tag_name(false, @options[:index])}" "#{tag_name(false, @options[:index])}"
end end
end end
......
...@@ -614,7 +614,7 @@ def method_tag(method) ...@@ -614,7 +614,7 @@ def method_tag(method)
# #
# to_form_params({ name: 'Denmark' }, 'country') # to_form_params({ name: 'Denmark' }, 'country')
# # => [{name: 'country[name]', value: 'Denmark'}] # # => [{name: 'country[name]', value: 'Denmark'}]
def to_form_params(attribute, namespace = nil) # :nodoc: def to_form_params(attribute, namespace = nil)
attribute = if attribute.respond_to?(:permitted?) attribute = if attribute.respond_to?(:permitted?)
unless attribute.permitted? unless attribute.permitted?
raise ArgumentError, "Attempting to generate a buttom from non-sanitized request parameters!" \ raise ArgumentError, "Attempting to generate a buttom from non-sanitized request parameters!" \
......
...@@ -338,7 +338,7 @@ def _layout(formats) ...@@ -338,7 +338,7 @@ def _layout(formats)
# #
# ==== Returns # ==== Returns
# * <tt>String</tt> - A template name # * <tt>String</tt> - A template name
def _implied_layout_name # :nodoc: def _implied_layout_name
controller_path controller_path
end end
end end
......
...@@ -29,7 +29,7 @@ def each(&block) ...@@ -29,7 +29,7 @@ def each(&block)
# This is the same logging logic as in ShowExceptions middleware. # This is the same logging logic as in ShowExceptions middleware.
# TODO Once "exceptron" is in, refactor this piece to simply re-use exceptron. # TODO Once "exceptron" is in, refactor this piece to simply re-use exceptron.
def log_error(exception) #:nodoc: def log_error(exception)
logger = ActionView::Base.logger logger = ActionView::Base.logger
return unless logger return unless logger
......
...@@ -44,7 +44,7 @@ def determine_template(options) ...@@ -44,7 +44,7 @@ def determine_template(options)
# Renders the given template. A string representing the layout can be # Renders the given template. A string representing the layout can be
# supplied as well. # supplied as well.
def render_template(template, layout_name = nil, locals = nil) #:nodoc: def render_template(template, layout_name = nil, locals = nil)
view, locals = @view, locals || {} view, locals = @view, locals || {}
render_with_layout(layout_name, locals) do |layout| render_with_layout(layout_name, locals) do |layout|
...@@ -54,7 +54,7 @@ def render_template(template, layout_name = nil, locals = nil) #:nodoc: ...@@ -54,7 +54,7 @@ def render_template(template, layout_name = nil, locals = nil) #:nodoc:
end end
end end
def render_with_layout(path, locals) #:nodoc: def render_with_layout(path, locals)
layout = path && find_layout(path, locals.keys, [formats.first]) layout = path && find_layout(path, locals.keys, [formats.first])
content = yield(layout) content = yield(layout)
......
...@@ -91,7 +91,7 @@ def rendered_format ...@@ -91,7 +91,7 @@ def rendered_format
# Find and render a template based on the options given. # Find and render a template based on the options given.
# :api: private # :api: private
def _render_template(options) #:nodoc: def _render_template(options)
variant = options.delete(:variant) variant = options.delete(:variant)
assigns = options.delete(:assigns) assigns = options.delete(:assigns)
context = view_context context = view_context
...@@ -104,7 +104,7 @@ def _render_template(options) #:nodoc: ...@@ -104,7 +104,7 @@ def _render_template(options) #:nodoc:
end end
# Assign the rendered format to look up context. # Assign the rendered format to look up context.
def _process_format(format) #:nodoc: def _process_format(format)
super super
lookup_context.formats = [format.to_sym] lookup_context.formats = [format.to_sym]
lookup_context.rendered_format = lookup_context.formats.first lookup_context.rendered_format = lookup_context.formats.first
......
...@@ -177,7 +177,7 @@ def build_path(name, prefix, partial) ...@@ -177,7 +177,7 @@ def build_path(name, prefix, partial)
# always check the cache before hitting the resolver. Otherwise, # always check the cache before hitting the resolver. Otherwise,
# it always hits the resolver but if the key is present, check if the # it always hits the resolver but if the key is present, check if the
# resolver is fresher before returning it. # resolver is fresher before returning it.
def cached(key, path_info, details, locals) #:nodoc: def cached(key, path_info, details, locals)
name, prefix, partial = path_info name, prefix, partial = path_info
locals = locals.map(&:to_s).sort! locals = locals.map(&:to_s).sort!
...@@ -191,7 +191,7 @@ def cached(key, path_info, details, locals) #:nodoc: ...@@ -191,7 +191,7 @@ def cached(key, path_info, details, locals) #:nodoc:
end end
# Ensures all the resolver information is set in the template. # Ensures all the resolver information is set in the template.
def decorate(templates, path_info, details, locals) #:nodoc: def decorate(templates, path_info, details, locals)
cached = nil cached = nil
templates.each do |t| templates.each do |t|
t.locals = locals t.locals = locals
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册