Class: Rafflesia::ArchiveInventoryData

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/artifacts/archive_inventory_data.rb

Constant Summary collapse

HASH_ATTRS =
{
  archive_format: :archive_format,
  directory_count: :directory_count,
  extract: :extract,
  extracted_count: :extracted_count,
  file_count: :file_count,
  include_extensions: :include_extensions,
  include_path_substrings: :include_path_substrings,
  inventory_object: :inventory_object,
  inventory_path: :inventory_path,
  max_extracted_members: :max_extracted_members,
  max_member_bytes: :max_member_bytes,
  member_count: :member_count,
  members: :members,
  object_id: :object_id,
  output_dir: :output_dir,
  phase_timings_ms: :phase_timings_ms,
  skipped_extraction_count: :skipped_extraction_count,
  table_object: :table_object,
  table_path: :table_path,
  total_compressed_bytes: :total_compressed_bytes,
  total_uncompressed_bytes: :total_uncompressed_bytes
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ ArchiveInventoryData

Returns a new instance of ArchiveInventoryData.



55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/rafflesia/artifacts/archive_inventory_data.rb', line 55

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @archive_format = hash[:archive_format]
  @directory_count = hash[:directory_count]
  @extract = hash[:extract]
  @extracted_count = hash[:extracted_count]
  @file_count = hash[:file_count]
  @include_extensions = (hash[:include_extensions] || [])
  @include_path_substrings = (hash[:include_path_substrings] || [])
  @inventory_object = hash[:inventory_object] ? Rafflesia::ObjectRef.new(hash[:inventory_object]) : nil
  @inventory_path = hash[:inventory_path]
  @max_extracted_members = hash[:max_extracted_members]
  @max_member_bytes = hash[:max_member_bytes]
  @member_count = hash[:member_count]
  @members = (hash[:members] || []).map { |item| item ? Rafflesia::ArchiveMemberRecord.new(item) : nil }
  @object_id = hash[:object_id]
  @output_dir = hash[:output_dir]
  @phase_timings_ms = hash[:phase_timings_ms] || {}
  @skipped_extraction_count = hash[:skipped_extraction_count]
  @table_object = hash[:table_object] ? Rafflesia::ObjectRef.new(hash[:table_object]) : nil
  @table_path = hash[:table_path]
  @total_compressed_bytes = hash[:total_compressed_bytes]
  @total_uncompressed_bytes = hash[:total_uncompressed_bytes]
end

Instance Attribute Details

#archive_formatObject

Returns the value of attribute archive_format.



32
33
34
# File 'lib/rafflesia/artifacts/archive_inventory_data.rb', line 32

def archive_format
  @archive_format
end

#directory_countObject

Returns the value of attribute directory_count.



32
33
34
# File 'lib/rafflesia/artifacts/archive_inventory_data.rb', line 32

def directory_count
  @directory_count
end

#extractObject

Returns the value of attribute extract.



32
33
34
# File 'lib/rafflesia/artifacts/archive_inventory_data.rb', line 32

def extract
  @extract
end

#extracted_countObject

Returns the value of attribute extracted_count.



32
33
34
# File 'lib/rafflesia/artifacts/archive_inventory_data.rb', line 32

def extracted_count
  @extracted_count
end

#file_countObject

Returns the value of attribute file_count.



32
33
34
# File 'lib/rafflesia/artifacts/archive_inventory_data.rb', line 32

def file_count
  @file_count
end

#include_extensionsObject

Returns the value of attribute include_extensions.



32
33
34
# File 'lib/rafflesia/artifacts/archive_inventory_data.rb', line 32

def include_extensions
  @include_extensions
end

#include_path_substringsObject

Returns the value of attribute include_path_substrings.



32
33
34
# File 'lib/rafflesia/artifacts/archive_inventory_data.rb', line 32

def include_path_substrings
  @include_path_substrings
end

#inventory_objectObject

Returns the value of attribute inventory_object.



32
33
34
# File 'lib/rafflesia/artifacts/archive_inventory_data.rb', line 32

def inventory_object
  @inventory_object
end

#inventory_pathObject

Returns the value of attribute inventory_path.



32
33
34
# File 'lib/rafflesia/artifacts/archive_inventory_data.rb', line 32

def inventory_path
  @inventory_path
end

#max_extracted_membersObject

Returns the value of attribute max_extracted_members.



32
33
34
# File 'lib/rafflesia/artifacts/archive_inventory_data.rb', line 32

def max_extracted_members
  @max_extracted_members
end

#max_member_bytesObject

Returns the value of attribute max_member_bytes.



32
33
34
# File 'lib/rafflesia/artifacts/archive_inventory_data.rb', line 32

def max_member_bytes
  @max_member_bytes
end

#member_countObject

Returns the value of attribute member_count.



32
33
34
# File 'lib/rafflesia/artifacts/archive_inventory_data.rb', line 32

def member_count
  @member_count
end

#membersObject

Returns the value of attribute members.



32
33
34
# File 'lib/rafflesia/artifacts/archive_inventory_data.rb', line 32

def members
  @members
end

#object_idObject

Returns the value of attribute object_id.



32
33
34
# File 'lib/rafflesia/artifacts/archive_inventory_data.rb', line 32

def object_id
  @object_id
end

#output_dirObject

Returns the value of attribute output_dir.



32
33
34
# File 'lib/rafflesia/artifacts/archive_inventory_data.rb', line 32

def output_dir
  @output_dir
end

#phase_timings_msObject

Returns the value of attribute phase_timings_ms.



32
33
34
# File 'lib/rafflesia/artifacts/archive_inventory_data.rb', line 32

def phase_timings_ms
  @phase_timings_ms
end

#skipped_extraction_countObject

Returns the value of attribute skipped_extraction_count.



32
33
34
# File 'lib/rafflesia/artifacts/archive_inventory_data.rb', line 32

def skipped_extraction_count
  @skipped_extraction_count
end

#table_objectObject

Returns the value of attribute table_object.



32
33
34
# File 'lib/rafflesia/artifacts/archive_inventory_data.rb', line 32

def table_object
  @table_object
end

#table_pathObject

Returns the value of attribute table_path.



32
33
34
# File 'lib/rafflesia/artifacts/archive_inventory_data.rb', line 32

def table_path
  @table_path
end

#total_compressed_bytesObject

Returns the value of attribute total_compressed_bytes.



32
33
34
# File 'lib/rafflesia/artifacts/archive_inventory_data.rb', line 32

def total_compressed_bytes
  @total_compressed_bytes
end

#total_uncompressed_bytesObject

Returns the value of attribute total_uncompressed_bytes.



32
33
34
# File 'lib/rafflesia/artifacts/archive_inventory_data.rb', line 32

def total_uncompressed_bytes
  @total_uncompressed_bytes
end