Sha256: 0f37b860cd2ff424001b317034b70e14b8c5171b6faec567928fdd3cbdbc5e2f
Contents?: true
Size: 731 Bytes
Versions: 18
Compression:
Stored size: 731 Bytes
Contents
# encoding: utf-8 module RuboCop module Cop module Style # This cop makes sure that all variables use the configured style, # snake_case or camelCase, for their names. class VariableName < Cop include ConfigurableNaming def on_lvasgn(node) name, = *node check_name(node, name, node.loc.name) end def on_ivasgn(node) name, = *node check_name(node, name, node.loc.name) end def on_cvasgn(node) name, = *node check_name(node, name, node.loc.name) end private def message(style) format('Use %s for variable names.', style) end end end end end
Version data entries
18 entries across 18 versions & 2 rubygems