Class: RuboCop::Isucon::GDA::NodeLocation
- Inherits:
-
Object
- Object
- RuboCop::Isucon::GDA::NodeLocation
- Defined in:
- lib/rubocop/isucon/gda/node_location.rb
Overview
Location in SQL
Instance Attribute Summary collapse
- #begin_pos ⇒ Integer readonly
- #body ⇒ String readonly
- #end_pos ⇒ Integer readonly
Instance Method Summary collapse
- #==(other) ⇒ Boolean
-
#initialize(begin_pos:, end_pos:, body:) ⇒ NodeLocation
constructor
A new instance of NodeLocation.
- #length ⇒ Integer
Constructor Details
#initialize(begin_pos:, end_pos:, body:) ⇒ NodeLocation
Returns a new instance of NodeLocation.
20 21 22 23 24 |
# File 'lib/rubocop/isucon/gda/node_location.rb', line 20 def initialize(begin_pos:, end_pos:, body:) @begin_pos = begin_pos @end_pos = end_pos @body = body end |
Instance Attribute Details
#begin_pos ⇒ Integer (readonly)
9 10 11 |
# File 'lib/rubocop/isucon/gda/node_location.rb', line 9 def begin_pos @begin_pos end |
#body ⇒ String (readonly)
15 16 17 |
# File 'lib/rubocop/isucon/gda/node_location.rb', line 15 def body @body end |
#end_pos ⇒ Integer (readonly)
12 13 14 |
# File 'lib/rubocop/isucon/gda/node_location.rb', line 12 def end_pos @end_pos end |
Instance Method Details
#==(other) ⇒ Boolean
28 29 30 31 32 33 |
# File 'lib/rubocop/isucon/gda/node_location.rb', line 28 def ==(other) other.is_a?(NodeLocation) && begin_pos == other.begin_pos && end_pos == other.end_pos && body == other.body end |
#length ⇒ Integer
36 37 38 |
# File 'lib/rubocop/isucon/gda/node_location.rb', line 36 def length end_pos - begin_pos end |