Sha256: 73f6e567d75bee554bc5b89b4cb64d944d34f8275eaa3ead1c1865e97c33c395
Contents?: true
Size: 978 Bytes
Versions: 2
Compression:
Stored size: 978 Bytes
Contents
require 'virtus' require 'rubycritic/core/location' module Rubycritic class Smell include Virtus.model attribute :context attribute :cost attribute :locations, Array, default: [] attribute :message attribute :score attribute :status attribute :type def at_location?(other_location) locations.any? { |location| location == other_location } end def multiple_locations? locations.length > 1 end def ==(other) state == other.state end 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 } end def to_json(*a) to_h.to_json(*a) end def hash state.hash end protected def state [@context, @message, @score, @type] end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rubycritic-2.7.1 | lib/rubycritic/core/smell.rb |
rubycritic-2.7.0 | lib/rubycritic/core/smell.rb |