Class: Rubycritic::Smell
- Inherits:
-
Object
- Object
- Rubycritic::Smell
- Defined in:
- lib/rubycritic/smell.rb
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
- #located_in?(other_location) ⇒ Boolean
- #pathnames ⇒ Object
- #to_s ⇒ Object
Instance Method Details
#<=>(other) ⇒ Object
29 30 31 |
# File 'lib/rubycritic/smell.rb', line 29 def <=>(other) locations <=> other.locations end |
#==(other) ⇒ Object Also known as: eql?
24 25 26 |
# File 'lib/rubycritic/smell.rb', line 24 def ==(other) self.class == other.class && state == other.state end |
#hash ⇒ Object
37 38 39 |
# File 'lib/rubycritic/smell.rb', line 37 def hash state.hash end |
#located_in?(other_location) ⇒ Boolean
20 21 22 |
# File 'lib/rubycritic/smell.rb', line 20 def located_in?(other_location) locations.any? { |location| location == other_location } end |
#pathnames ⇒ Object
16 17 18 |
# File 'lib/rubycritic/smell.rb', line 16 def pathnames @pathnames ||= locations.map(&:pathname).uniq end |
#to_s ⇒ Object
33 34 35 |
# File 'lib/rubycritic/smell.rb', line 33 def to_s "(#{type}) #{context} #{}" end |