lib/ratebeer/urls.rb
Use %i
or %I
for an array of symbols. Open
Open
[:beer_url,
:brewery_url,
:country_url,
:region_url,
:style_url,
- Read upRead up
- Exclude checks
This cop can check for array literals made up of symbols that are not using the %i() syntax.
Alternatively, it checks for symbol arrays using the %i() syntax on projects which do not want to use that syntax.
Configuration option: MinSize
If set, arrays with fewer elements than this value will not trigger the
cop. For example, a MinSize of
3` will not enforce a style on an array
of 2 or fewer elements.
Example: EnforcedStyle: percent (default)
# good
%i[foo bar baz]
# bad
[:foo, :bar, :baz]
Example: EnforcedStyle: brackets
# good
[:foo, :bar, :baz]
# bad
%i[foo bar baz]
Trailing whitespace detected. Open
Open
[:beer_url,
- Exclude checks
Freeze mutable objects assigned to constants. Open
Open
BASE_URL = 'https://www.ratebeer.com'
- Read upRead up
- Exclude checks
This cop checks whether some constant value isn't a mutable literal (e.g. array or hash).
Example:
# bad
CONST = [1, 2, 3]
# good
CONST = [1, 2, 3].freeze
Freeze mutable objects assigned to constants. Open
Open
SEARCH_URL = '/search'
- Read upRead up
- Exclude checks
This cop checks whether some constant value isn't a mutable literal (e.g. array or hash).
Example:
# bad
CONST = [1, 2, 3]
# good
CONST = [1, 2, 3].freeze
Trailing whitespace detected. Open
Open
:country_url,
- Exclude checks