Class: Uniword::Diff::ZipMetadataChange

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

Overview

Value object holding ZIP entry metadata differences.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(part:, differences:) ⇒ ZipMetadataChange

Returns a new instance of ZipMetadataChange.

Parameters:

  • part (String)

    ZIP entry name

  • differences (Hash{Symbol => Array})

    keys: :compression, :internal_attr, :external_attr, :timestamp, :flag_bits



30
31
32
33
# File 'lib/uniword/diff/package_diff_result.rb', line 30

def initialize(part:, differences:)
  @part = part
  @differences = differences
end

Instance Attribute Details

#differencesObject (readonly)

Returns the value of attribute differences.



25
26
27
# File 'lib/uniword/diff/package_diff_result.rb', line 25

def differences
  @differences
end

#partObject (readonly)

Returns the value of attribute part.



25
26
27
# File 'lib/uniword/diff/package_diff_result.rb', line 25

def part
  @part
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/uniword/diff/package_diff_result.rb', line 35

def empty?
  @differences.empty?
end

#to_hObject



39
40
41
# File 'lib/uniword/diff/package_diff_result.rb', line 39

def to_h
  { part: @part, differences: @differences }
end