lib/scaffolder/region/insert.rb in scaffolder-0.4.2 vs lib/scaffolder/region/insert.rb in scaffolder-0.4.3
- old
+ new
@@ -38,14 +38,22 @@
def position
raise CoordinateError if @close.nil? && @open.nil?
open-1..close-1
end
- # Inserts are comaprable by close position.
+ # Inserts are comparable by close position.
#
# @return [Integer]
# @param [Scaffolder::Region::Insert]
def <=>(other)
self.close <=> other.close
+ end
+
+ # The difference in the insert sequence size and the insert location
+ #
+ # @return [Integer]
+ def size_diff
+ insert_size = (close - open) + 1
+ sequence.length - insert_size
end
end