Class: Rafflesia::BlastDbDescribeData

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/sequences/blast_db_describe_data.rb

Constant Summary collapse

HASH_ATTRS =
{
  artifact_count: :artifact_count,
  artifacts: :artifacts,
  manifest: :manifest,
  manifest_path: :manifest_path,
  ref: :ref,
  registry_record: :registry_record,
  total_size_bytes: :total_size_bytes
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ BlastDbDescribeData

Returns a new instance of BlastDbDescribeData.



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/rafflesia/sequences/blast_db_describe_data.rb', line 27

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @artifact_count = hash[:artifact_count]
  @artifacts = (hash[:artifacts] || []).map { |item| item ? Rafflesia::BlastDbArtifactState.new(item) : nil }
  @manifest = hash[:manifest] ? Rafflesia::BlastDbManifest.new(hash[:manifest]) : nil
  @manifest_path = hash[:manifest_path]
  @ref = hash[:ref]
  @registry_record = hash[:registry_record] ? Rafflesia::BlastDbRegistryRecord.new(hash[:registry_record]) : nil
  @total_size_bytes = hash[:total_size_bytes]
end

Instance Attribute Details

#artifact_countObject

Returns the value of attribute artifact_count.



18
19
20
# File 'lib/rafflesia/sequences/blast_db_describe_data.rb', line 18

def artifact_count
  @artifact_count
end

#artifactsObject

Returns the value of attribute artifacts.



18
19
20
# File 'lib/rafflesia/sequences/blast_db_describe_data.rb', line 18

def artifacts
  @artifacts
end

#manifestObject

Returns the value of attribute manifest.



18
19
20
# File 'lib/rafflesia/sequences/blast_db_describe_data.rb', line 18

def manifest
  @manifest
end

#manifest_pathObject

Returns the value of attribute manifest_path.



18
19
20
# File 'lib/rafflesia/sequences/blast_db_describe_data.rb', line 18

def manifest_path
  @manifest_path
end

#refObject

Returns the value of attribute ref.



18
19
20
# File 'lib/rafflesia/sequences/blast_db_describe_data.rb', line 18

def ref
  @ref
end

#registry_recordObject

Returns the value of attribute registry_record.



18
19
20
# File 'lib/rafflesia/sequences/blast_db_describe_data.rb', line 18

def registry_record
  @registry_record
end

#total_size_bytesObject

Returns the value of attribute total_size_bytes.



18
19
20
# File 'lib/rafflesia/sequences/blast_db_describe_data.rb', line 18

def total_size_bytes
  @total_size_bytes
end