Class: Rafflesia::SearchSegmentManifest

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/proteins/search_segment_manifest.rb

Constant Summary collapse

HASH_ATTRS =
{
  algorithm: :algorithm,
  block_bytes: :block_bytes,
  block_count: :block_count,
  block_size_bytes: :block_size_bytes,
  blocks: :blocks,
  bundle_object: :bundle_object,
  content_sha256: :content_sha_256,
  created_at: :created_at,
  dataset_name: :dataset_name,
  dataset_version: :dataset_version,
  footer_length_bytes: :footer_length_bytes,
  footer_offset_bytes: :footer_offset_bytes,
  footer_sha256: :footer_sha_256,
  key_mode: :key_mode,
  kind: :kind,
  layout: :layout,
  manifest_version: :manifest_version,
  name: :name,
  record_count: :record_count,
  root_object: :root_object,
  root_sha256: :root_sha_256,
  segment_id: :segment_id,
  source_object: :source_object,
  tool_versions: :tool_versions,
  version: :version
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ SearchSegmentManifest

Returns a new instance of SearchSegmentManifest.



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/rafflesia/proteins/search_segment_manifest.rb', line 63

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @algorithm = hash[:algorithm]
  @block_bytes = hash[:block_bytes]
  @block_count = hash[:block_count]
  @block_size_bytes = hash[:block_size_bytes]
  @blocks = (hash[:blocks] || []).map { |item| item ? Rafflesia::SearchSegmentBlock.new(item) : nil }
  @bundle_object = hash[:bundle_object] ? Rafflesia::ObjectRef.new(hash[:bundle_object]) : nil
  @content_sha_256 = hash[:content_sha256]
  @created_at = hash[:created_at]
  @dataset_name = hash[:dataset_name]
  @dataset_version = hash[:dataset_version]
  @footer_length_bytes = hash[:footer_length_bytes]
  @footer_offset_bytes = hash[:footer_offset_bytes]
  @footer_sha_256 = hash[:footer_sha256]
  @key_mode = hash[:key_mode]
  @kind = hash[:kind]
  @layout = hash[:layout]
  @manifest_version = hash[:manifest_version]
  @name = hash[:name]
  @record_count = hash[:record_count]
  @root_object = hash[:root_object] ? Rafflesia::ObjectRef.new(hash[:root_object]) : nil
  @root_sha_256 = hash[:root_sha256]
  @segment_id = hash[:segment_id]
  @source_object = hash[:source_object] ? Rafflesia::ObjectRef.new(hash[:source_object]) : nil
  @tool_versions = (hash[:tool_versions] || []).map { |item| item ? Rafflesia::ToolVersion.new(item) : nil }
  @version = hash[:version]
end

Instance Attribute Details

#algorithmObject

Returns the value of attribute algorithm.



36
37
38
# File 'lib/rafflesia/proteins/search_segment_manifest.rb', line 36

def algorithm
  @algorithm
end

#block_bytesObject

Returns the value of attribute block_bytes.



36
37
38
# File 'lib/rafflesia/proteins/search_segment_manifest.rb', line 36

def block_bytes
  @block_bytes
end

#block_countObject

Returns the value of attribute block_count.



36
37
38
# File 'lib/rafflesia/proteins/search_segment_manifest.rb', line 36

def block_count
  @block_count
end

#block_size_bytesObject

Returns the value of attribute block_size_bytes.



36
37
38
# File 'lib/rafflesia/proteins/search_segment_manifest.rb', line 36

def block_size_bytes
  @block_size_bytes
end

#blocksObject

Returns the value of attribute blocks.



36
37
38
# File 'lib/rafflesia/proteins/search_segment_manifest.rb', line 36

def blocks
  @blocks
end

#bundle_objectObject

Returns the value of attribute bundle_object.



36
37
38
# File 'lib/rafflesia/proteins/search_segment_manifest.rb', line 36

def bundle_object
  @bundle_object
end

#content_sha_256Object

Returns the value of attribute content_sha_256.



36
37
38
# File 'lib/rafflesia/proteins/search_segment_manifest.rb', line 36

def content_sha_256
  @content_sha_256
end

#created_atObject

Returns the value of attribute created_at.



36
37
38
# File 'lib/rafflesia/proteins/search_segment_manifest.rb', line 36

def created_at
  @created_at
end

#dataset_nameObject

Returns the value of attribute dataset_name.



36
37
38
# File 'lib/rafflesia/proteins/search_segment_manifest.rb', line 36

def dataset_name
  @dataset_name
end

#dataset_versionObject

Returns the value of attribute dataset_version.



36
37
38
# File 'lib/rafflesia/proteins/search_segment_manifest.rb', line 36

def dataset_version
  @dataset_version
end

Returns the value of attribute footer_length_bytes.



36
37
38
# File 'lib/rafflesia/proteins/search_segment_manifest.rb', line 36

def footer_length_bytes
  @footer_length_bytes
end

Returns the value of attribute footer_offset_bytes.



36
37
38
# File 'lib/rafflesia/proteins/search_segment_manifest.rb', line 36

def footer_offset_bytes
  @footer_offset_bytes
end

Returns the value of attribute footer_sha_256.



36
37
38
# File 'lib/rafflesia/proteins/search_segment_manifest.rb', line 36

def footer_sha_256
  @footer_sha_256
end

#key_modeObject

Returns the value of attribute key_mode.



36
37
38
# File 'lib/rafflesia/proteins/search_segment_manifest.rb', line 36

def key_mode
  @key_mode
end

#kindObject

Returns the value of attribute kind.



36
37
38
# File 'lib/rafflesia/proteins/search_segment_manifest.rb', line 36

def kind
  @kind
end

#layoutObject

Returns the value of attribute layout.



36
37
38
# File 'lib/rafflesia/proteins/search_segment_manifest.rb', line 36

def layout
  @layout
end

#manifest_versionObject

Returns the value of attribute manifest_version.



36
37
38
# File 'lib/rafflesia/proteins/search_segment_manifest.rb', line 36

def manifest_version
  @manifest_version
end

#nameObject

Returns the value of attribute name.



36
37
38
# File 'lib/rafflesia/proteins/search_segment_manifest.rb', line 36

def name
  @name
end

#record_countObject

Returns the value of attribute record_count.



36
37
38
# File 'lib/rafflesia/proteins/search_segment_manifest.rb', line 36

def record_count
  @record_count
end

#root_objectObject

Returns the value of attribute root_object.



36
37
38
# File 'lib/rafflesia/proteins/search_segment_manifest.rb', line 36

def root_object
  @root_object
end

#root_sha_256Object

Returns the value of attribute root_sha_256.



36
37
38
# File 'lib/rafflesia/proteins/search_segment_manifest.rb', line 36

def root_sha_256
  @root_sha_256
end

#segment_idObject

Returns the value of attribute segment_id.



36
37
38
# File 'lib/rafflesia/proteins/search_segment_manifest.rb', line 36

def segment_id
  @segment_id
end

#source_objectObject

Returns the value of attribute source_object.



36
37
38
# File 'lib/rafflesia/proteins/search_segment_manifest.rb', line 36

def source_object
  @source_object
end

#tool_versionsObject

Returns the value of attribute tool_versions.



36
37
38
# File 'lib/rafflesia/proteins/search_segment_manifest.rb', line 36

def tool_versions
  @tool_versions
end

#versionObject

Returns the value of attribute version.



36
37
38
# File 'lib/rafflesia/proteins/search_segment_manifest.rb', line 36

def version
  @version
end