app/models/address.rb
Method has too many lines. [10/7] (https://github.com/bbatsov/ruby-style-guide#short-methods) Open
Open
def parse
address = value.to_s
postcode = ''
match = value.to_s.match(/(.*)(,\s*(\w\w\d\s* \d\w\w))/)
if match
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Don't extend an instance initialized by Struct.new
. (https://github.com/bbatsov/ruby-style-guide#no-extend-struct-new) Open
Open
class Address < Struct.new(:value)
- Read upRead up
- Exclude checks
This cop checks for inheritance from Struct.new.
Example:
# bad
class Person < Struct.new(:first_name, :last_name)
end
# good
Person = Struct.new(:first_name, :last_name)