Class: Y::Diff

Inherits:
Object
  • Object
show all
Defined in:
lib/y/diff.rb

Overview

A representation of an uniformly-formatted chunk of rich context stored by Text or XmlText. It contains a value (which could be a string, embedded object or another shared type) with optional formatting attributes wrapping around this chunk.

Instance Method Summary collapse

Instance Method Details

#attrsHash

Returns:

  • (Hash)


15
16
17
# File 'lib/y/diff.rb', line 15

def attrs
  ydiff_attrs
end

#insertObject

Returns:

  • (Object)


10
11
12
# File 'lib/y/diff.rb', line 10

def insert
  ydiff_insert
end

#to_hHash

Convert the diff to a Hash representation

Returns:

  • (Hash)


22
23
24
25
26
27
# File 'lib/y/diff.rb', line 22

def to_h
  {
    insert: ydiff_insert,
    attrs: ydiff_attrs
  }
end

#ydiff_attrsHash

Returns:

  • (Hash)


# File 'lib/y/diff.rb', line 34

#ydiff_insertObject

Returns string representation of text



# File 'lib/y/diff.rb', line 29