Class: Rinline::Location

Inherits:
Object
  • Object
show all
Defined in:
lib/rinline/location.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_indexObject (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_indexObject (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

#sizeObject



10
11
12
# File 'lib/rinline/location.rb', line 10

def size
  last_index - first_index + 1
end