app/components/ninetails/property_type.rb
Use Hash#key?
instead of Hash#has_key?
. Open
Open
if values.is_a?(Hash) && !values.with_indifferent_access.has_key?(:reference)
- Read upRead up
- Exclude checks
This cop (by default) checks for uses of methods Hash#haskey? and
Hash#hasvalue? where it enforces Hash#key? and Hash#value?
It is configurable to enforce the inverse, using verbose
method
names also.
Example: EnforcedStyle: short (default)
# bad Hash#haskey? Hash#hasvalue?
# good Hash#key? Hash#value?
Example: EnforcedStyle: verbose
# bad Hash#key? Hash#value?
# good Hash#haskey? Hash#hasvalue?
Method Ninetails::PropertyType#serialized_values=
is defined at both app/components/ninetails/property_type.rb:3 and app/components/ninetails/property_type.rb:19. Open
Open
def serialized_values=(values)
- Read upRead up
- Exclude checks
This cop checks for duplicated instance (or singleton) method definitions.
Example:
# bad
def duplicated
1
end
def duplicated
2
end
Example:
# bad
def duplicated
1
end
alias duplicated other_duplicated
Example:
# good
def duplicated
1
end
def other_duplicated
2
end