class EPUB::CFI::Range

Attributes

end_subpath[RW]
parent_path[RW]
start_subpath[RW]

Public Class Methods

from_parent_and_start_and_end(parent_path, start_subpath, end_subpath) click to toggle source
# File lib/epub/cfi.rb, line 165
def from_parent_and_start_and_end(parent_path, start_subpath, end_subpath)
  first = Location.from_parent_and_subpath(parent_path, start_subpath)
  last = Location.from_parent_and_subpath(parent_path, end_subpath)

  new_range = new(first, last)

  new_range.parent_path = Location.new(parent_path)
  new_range.start_subpath = start_subpath.join("!")
  new_range.end_subpath = end_subpath.join("!")

  new_range
end

Public Instance Methods

to_s() click to toggle source
# File lib/epub/cfi.rb, line 179
def to_s
  @string_cache ||= "epubcfi(#{@parent_path.path_string},#{@start_subpath},#{@end_subpath})"
end