Method: Interval#distance
- Defined in:
- lib/mega/interval.rb
#distance ⇒ Object Also known as: length, size
Returns the length of the interval as the difference between the first and last elements. Returns nil if the sentinal objects do not support distance comparison (#distance). TODO: Add n parameter to count segmentations like those produced by #each.
159 160 161 162 163 164 165 166 |
# File 'lib/mega/interval.rb', line 159 def distance @last - @first #if @last.respond_to?( :distance ) # @last.distance( @first ) #else # #self.to_a.length #end end |