Class: Rubycritic::Location
- Inherits:
-
Object
- Object
- Rubycritic::Location
- Defined in:
- lib/rubycritic/location.rb
Instance Attribute Summary collapse
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#pathname ⇒ Object
readonly
Returns the value of attribute pathname.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #==(other) ⇒ Object
-
#initialize(path, line) ⇒ Location
constructor
A new instance of Location.
- #to_s ⇒ Object
Constructor Details
#initialize(path, line) ⇒ Location
Returns a new instance of Location.
8 9 10 11 |
# File 'lib/rubycritic/location.rb', line 8 def initialize(path, line) @pathname = Pathname.new(path) @line = line end |
Instance Attribute Details
#line ⇒ Object (readonly)
Returns the value of attribute line.
6 7 8 |
# File 'lib/rubycritic/location.rb', line 6 def line @line end |
#pathname ⇒ Object (readonly)
Returns the value of attribute pathname.
6 7 8 |
# File 'lib/rubycritic/location.rb', line 6 def pathname @pathname end |
Instance Method Details
#<=>(other) ⇒ Object
21 22 23 |
# File 'lib/rubycritic/location.rb', line 21 def <=>(other) state <=> other.state end |
#==(other) ⇒ Object
17 18 19 |
# File 'lib/rubycritic/location.rb', line 17 def ==(other) self.class == other.class && state == other.state end |
#to_s ⇒ Object
13 14 15 |
# File 'lib/rubycritic/location.rb', line 13 def to_s "#{pathname}:#{line}" end |