class EPUB::CFI::Step

Attributes

assertion[R]
step[R]
value[R]

Public Class Methods

new(value, assertion=nil) click to toggle source
# File lib/epub/cfi.rb, line 188
def initialize(value, assertion=nil)
  @value, @assertion = value, assertion
  @string_cache = nil
end

Public Instance Methods

<=>(other) click to toggle source
# File lib/epub/cfi.rb, line 202
def <=>(other)
  value <=> other.value
end
character_data?() click to toggle source
# File lib/epub/cfi.rb, line 210
def character_data?
  value.odd?
end
element?() click to toggle source
# File lib/epub/cfi.rb, line 206
def element?
  value.even?
end
initialize_copy(original) click to toggle source
# File lib/epub/cfi.rb, line 193
def initialize_copy(original)
  @value = original.value
  @assertion = original.assertion.dup if original.assertion
end
to_s() click to toggle source
# File lib/epub/cfi.rb, line 198
def to_s
  @string_cache ||= "/#{value}#{assertion}" # need escape?
end