HTMLDiff::Builder (Class)

In: libraries/diff/diff.rb
Parent: Object

Methods

do_op   new   result  

Constants

VALID_METHODS = [:replace, :insert, :delete, :equal]

Public Class methods

[Source]

     # File libraries/diff/diff.rb, line 314
314:     def initialize(a, b)
315:       @a = a
316:       @b = b
317:       @content = []
318:     end

Public Instance methods

[Source]

     # File libraries/diff/diff.rb, line 320
320:     def do_op(opcode)
321:       @opcode = opcode
322:       op = @opcode[0]
323:       VALID_METHODS.include?(op) or raise(NameError, "Invalid opcode #{op}")
324:       self.method(op).call
325:     end

[Source]

     # File libraries/diff/diff.rb, line 327
327:     def result
328:       @content.join('')
329:     end

[Validate]