Class: EPUB::CFI::Range
- Inherits:
-
Range
- Object
- Range
- EPUB::CFI::Range
- Defined in:
- lib/epub/cfi.rb
Instance Attribute Summary collapse
-
#end_subpath ⇒ Object
Returns the value of attribute end_subpath.
-
#parent_path ⇒ Object
Returns the value of attribute parent_path.
-
#start_subpath ⇒ Object
Returns the value of attribute start_subpath.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#end_subpath ⇒ Object
Returns the value of attribute end_subpath.
162 163 164 |
# File 'lib/epub/cfi.rb', line 162 def end_subpath @end_subpath end |
#parent_path ⇒ Object
Returns the value of attribute parent_path.
162 163 164 |
# File 'lib/epub/cfi.rb', line 162 def parent_path @parent_path end |
#start_subpath ⇒ Object
Returns the value of attribute start_subpath.
162 163 164 |
# File 'lib/epub/cfi.rb', line 162 def start_subpath @start_subpath end |
Class Method Details
.from_parent_and_start_and_end(parent_path, start_subpath, end_subpath) ⇒ Object
165 166 167 168 169 170 171 172 173 174 175 176 |
# 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 |
Instance Method Details
#to_s ⇒ Object
179 180 181 |
# File 'lib/epub/cfi.rb', line 179 def to_s @string_cache ||= "epubcfi(#{@parent_path.path_string},#{@start_subpath},#{@end_subpath})" end |