Class: Rubocop::Cop::Position
- Inherits:
-
Struct
- Object
- Struct
- Rubocop::Cop::Position
- Defined in:
- lib/rubocop/cop/cop.rb
Instance Attribute Summary collapse
-
#column ⇒ Object
Returns the value of attribute column.
-
#lineno ⇒ Object
Returns the value of attribute lineno.
Class Method Summary collapse
-
.make_position_objects(sexp) ⇒ Object
Does a recursive search and replaces each [lineno, column] array in the sexp with a Position object.
Instance Attribute Details
#column ⇒ Object
Returns the value of attribute column
5 6 7 |
# File 'lib/rubocop/cop/cop.rb', line 5 def column @column end |
#lineno ⇒ Object
Returns the value of attribute lineno
5 6 7 |
# File 'lib/rubocop/cop/cop.rb', line 5 def lineno @lineno end |
Class Method Details
.make_position_objects(sexp) ⇒ Object
Does a recursive search and replaces each [lineno, column] array in the sexp with a Position object.
8 9 10 11 12 13 14 |
# File 'lib/rubocop/cop/cop.rb', line 8 def self.make_position_objects(sexp) if sexp[0] =~ /^@/ sexp[2] = Position.new(*sexp[2]) else sexp.grep(Array).each { |s| make_position_objects(s) } end end |