Sha256: 6ab11570778ce39f4aa59c1a30ef3f6d232365591ac3d3928aca8a64d803ec5e

Contents?: true

Size: 671 Bytes

Versions: 16

Compression:

Stored size: 671 Bytes

Contents

# encoding: utf-8

module RuboCop
  module Cop
    module Style
      # This cop makes sure that all methods use the configured style,
      # snake_case or camelCase, for their names. Some special arrangements
      # have to be made for operator methods.
      class MethodName < Cop
        include ConfigurableNaming

        def on_def(node)
          name, = *node
          check_name(node, name, node.loc.name)
        end

        def on_defs(node)
          _object, name, = *node
          check_name(node, name, node.loc.name)
        end

        def message(style)
          format('Use %s for method names.', style)
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
rubocop-0.35.1 lib/rubocop/cop/style/method_name.rb
rubocop-0.35.0 lib/rubocop/cop/style/method_name.rb
rubocop-0.34.2 lib/rubocop/cop/style/method_name.rb
rubocop-0.34.1 lib/rubocop/cop/style/method_name.rb
rubocop-0.34.0 lib/rubocop/cop/style/method_name.rb
rubocop-0.33.0 lib/rubocop/cop/style/method_name.rb
rubocop-0.32.1 lib/rubocop/cop/style/method_name.rb
rubocop-0.32.0 lib/rubocop/cop/style/method_name.rb
rubocop-0.31.0 lib/rubocop/cop/style/method_name.rb
rubocop-0.30.1 lib/rubocop/cop/style/method_name.rb
rubocop-0.30.0 lib/rubocop/cop/style/method_name.rb
rubocop-0.29.1 lib/rubocop/cop/style/method_name.rb
rubocop-0.29.0 lib/rubocop/cop/style/method_name.rb
rubocop-0.28.0 lib/rubocop/cop/style/method_name.rb
rubocop-0.27.1 lib/rubocop/cop/style/method_name.rb
rubocop-0.27.0 lib/rubocop/cop/style/method_name.rb