lib/rubycritic/core/smell.rb in rubycritic-2.6.0 vs lib/rubycritic/core/smell.rb in rubycritic-2.7.0

- old
+ new

@@ -1,16 +1,15 @@ -require "virtus" -require "rubycritic/core/location" +require 'virtus' +require 'rubycritic/core/location' module Rubycritic - class Smell include Virtus.model attribute :context attribute :cost - attribute :locations, Array, :default => [] + attribute :locations, Array, default: [] attribute :message attribute :score attribute :status attribute :type @@ -23,25 +22,25 @@ end def ==(other) state == other.state end - alias_method :eql?, :== + alias eql? == def to_s "(#{type}) #{context} #{message}" end def to_h { - :context => context, - :cost => cost, - :locations => locations, - :message => message, - :score => score, - :status => status, - :type => type + context: context, + cost: cost, + locations: locations, + message: message, + score: score, + status: status, + type: type } end def to_json(*a) to_h.to_json(*a) @@ -55,7 +54,6 @@ def state [@context, @message, @score, @type] end end - end