class EPUB::CFI::TextLocationAssertion

Attributes

followed[R]
parameters[R]
preceded[R]

Public Class Methods

new(preceded=nil, followed=nil, parameters={}) click to toggle source
# File lib/epub/cfi.rb, line 239
def initialize(preceded=nil, followed=nil, parameters={})
  @preceded, @followed, @parameters = preceded, followed, parameters
  @string_cache = nil
end

Public Instance Methods

to_s() click to toggle source
# File lib/epub/cfi.rb, line 244
def to_s
  return @string_cache if @string_cache
  string_cache = '['
  string_cache << CFI.escape(preceded) if preceded
  string_cache << ',' << CFI.escape(followed) if followed
  parameters.each_pair do |key, values|
    value = values.join(',')
    string_cache << ";#{CFI.escape(key)}=#{CFI.escape(value)}"
  end
  string_cache << ']'
  @string_cache = string_cache
end