Class: Omnizip::Parity::Par2Verifier::VerificationResult

Inherits:
Struct
  • Object
show all
Defined in:
lib/omnizip/parity/par2_verifier.rb

Overview

Verification result

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#all_okObject

Returns the value of attribute all_ok

Returns:

  • (Object)

    the current value of all_ok



23
24
25
# File 'lib/omnizip/parity/par2_verifier.rb', line 23

def all_ok
  @all_ok
end

#damaged_blocksObject

Returns the value of attribute damaged_blocks

Returns:

  • (Object)

    the current value of damaged_blocks



23
24
25
# File 'lib/omnizip/parity/par2_verifier.rb', line 23

def damaged_blocks
  @damaged_blocks
end

#damaged_filesObject

Returns the value of attribute damaged_files

Returns:

  • (Object)

    the current value of damaged_files



23
24
25
# File 'lib/omnizip/parity/par2_verifier.rb', line 23

def damaged_files
  @damaged_files
end

#missing_filesObject

Returns the value of attribute missing_files

Returns:

  • (Object)

    the current value of missing_files



23
24
25
# File 'lib/omnizip/parity/par2_verifier.rb', line 23

def missing_files
  @missing_files
end

#recovery_blocksObject

Returns the value of attribute recovery_blocks

Returns:

  • (Object)

    the current value of recovery_blocks



23
24
25
# File 'lib/omnizip/parity/par2_verifier.rb', line 23

def recovery_blocks
  @recovery_blocks
end

#repairableObject

Returns the value of attribute repairable

Returns:

  • (Object)

    the current value of repairable



23
24
25
# File 'lib/omnizip/parity/par2_verifier.rb', line 23

def repairable
  @repairable
end

#total_blocksObject

Returns the value of attribute total_blocks

Returns:

  • (Object)

    the current value of total_blocks



23
24
25
# File 'lib/omnizip/parity/par2_verifier.rb', line 23

def total_blocks
  @total_blocks
end

Instance Method Details

#all_ok?Boolean

Check if all files are OK

Returns:

  • (Boolean)

    true if no damage detected



36
37
38
# File 'lib/omnizip/parity/par2_verifier.rb', line 36

def all_ok?
  damaged_files.empty? && missing_files.empty?
end

#damage_countInteger

Get total damage count

Returns:

  • (Integer)

    Number of damaged/missing blocks



50
51
52
# File 'lib/omnizip/parity/par2_verifier.rb', line 50

def damage_count
  damaged_blocks.size + missing_files.size
end

#repairable?Boolean

Check if damage can be repaired

Returns:

  • (Boolean)

    true if repairable



43
44
45
# File 'lib/omnizip/parity/par2_verifier.rb', line 43

def repairable?
  repairable
end