Class: Pack::Delta
Defined Under Namespace
Instance Attribute Summary collapse
-
#base ⇒ Object
readonly
Returns the value of attribute base.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(source, target) ⇒ Delta
constructor
A new instance of Delta.
Constructor Details
#initialize(source, target) ⇒ Delta
Returns a new instance of Delta.
40 41 42 43 44 45 46 47 48 |
# File 'lib/pack/delta.rb', line 40 def initialize(source, target) @base = source.entry @data = sizeof(source) + sizeof(target) source.delta_index ||= XDelta.create_index(source.data) delta = source.delta_index.compress(target.data) delta.each { |op| @data.concat(op.to_s) } end |
Instance Attribute Details
#base ⇒ Object (readonly)
Returns the value of attribute base.
38 39 40 |
# File 'lib/pack/delta.rb', line 38 def base @base end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
38 39 40 |
# File 'lib/pack/delta.rb', line 38 def data @data end |