Parent

Methods

Files

Class/Module Index [+]

Quicksearch

RuboCop::Cop::Style::FormatString

This cop enforces the use of a single string formatting utility. Valid options include Kernel#format, Kernel#sprintf and String#%.

The detection of String#% cannot be implemented in a reliable manner for all cases, so only two scenarios are considered - if the first argument is a string literal and if the second argument is an array literal.

Public Instance Methods

on_send(node) click to toggle source
# File lib/rubocop/cop/style/format_string.rb, line 15
def on_send(node)
  add_offense(node, :selector) if offending_node?(node)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.