Class: Rubycritic::Smell
- Inherits:
-
Object
- Object
- Rubycritic::Smell
- Defined in:
- lib/rubycritic/core/smell.rb
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #at_location?(other_location) ⇒ Boolean
- #hash ⇒ Object
- #multiple_locations? ⇒ Boolean
- #to_s ⇒ Object
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
25 26 27 |
# File 'lib/rubycritic/core/smell.rb', line 25 def ==(other) state == other.state end |
#at_location?(other_location) ⇒ Boolean
17 18 19 |
# File 'lib/rubycritic/core/smell.rb', line 17 def at_location?(other_location) locations.any? { |location| location == other_location } end |
#hash ⇒ Object
34 35 36 |
# File 'lib/rubycritic/core/smell.rb', line 34 def hash state.hash end |
#multiple_locations? ⇒ Boolean
21 22 23 |
# File 'lib/rubycritic/core/smell.rb', line 21 def multiple_locations? locations.length > 1 end |
#to_s ⇒ Object
30 31 32 |
# File 'lib/rubycritic/core/smell.rb', line 30 def to_s "(#{type}) #{context} #{}" end |