Class: Rinline::Location
- Inherits:
-
Object
- Object
- Rinline::Location
- Defined in:
- lib/rinline/location.rb
Instance Attribute Summary collapse
-
#first_index ⇒ Object
readonly
Returns the value of attribute first_index.
-
#last_index ⇒ Object
readonly
Returns the value of attribute last_index.
Instance Method Summary collapse
-
#initialize(first_index, last_index) ⇒ Location
constructor
A new instance of Location.
- #size ⇒ Object
Constructor Details
#initialize(first_index, last_index) ⇒ Location
Returns a new instance of Location.
3 4 5 6 |
# File 'lib/rinline/location.rb', line 3 def initialize(first_index, last_index) @first_index = first_index @last_index = last_index end |
Instance Attribute Details
#first_index ⇒ Object (readonly)
Returns the value of attribute first_index.
8 9 10 |
# File 'lib/rinline/location.rb', line 8 def first_index @first_index end |
#last_index ⇒ Object (readonly)
Returns the value of attribute last_index.
8 9 10 |
# File 'lib/rinline/location.rb', line 8 def last_index @last_index end |
Instance Method Details
#size ⇒ Object
10 11 12 |
# File 'lib/rinline/location.rb', line 10 def size last_index - first_index + 1 end |