Class: Rafflesia::ObjectArtifactCacheFileState

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/object_artifacts/object_artifact_cache_file_state.rb

Constant Summary collapse

HASH_ATTRS =
{
  error: :error,
  exists: :exists,
  expected_sha256: :expected_sha_256,
  expected_size_bytes: :expected_size_bytes,
  is_stale: :is_stale,
  local_name: :local_name,
  object: :object,
  path: :path,
  role: :role,
  sha256: :sha_256,
  shard_id: :shard_id,
  size_bytes: :size_bytes,
  status: :status,
  verified: :verified
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ ObjectArtifactCacheFileState

Returns a new instance of ObjectArtifactCacheFileState.



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/rafflesia/object_artifacts/object_artifact_cache_file_state.rb', line 41

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @error = hash[:error]
  @exists = hash[:exists]
  @expected_sha_256 = hash[:expected_sha256]
  @expected_size_bytes = hash[:expected_size_bytes]
  @is_stale = hash[:is_stale]
  @local_name = hash[:local_name]
  @object = hash[:object] ? Rafflesia::ObjectRef.new(hash[:object]) : nil
  @path = hash[:path]
  @role = hash[:role]
  @sha_256 = hash[:sha256]
  @shard_id = hash[:shard_id]
  @size_bytes = hash[:size_bytes]
  @status = hash[:status]
  @verified = hash[:verified]
end

Instance Attribute Details

#errorObject

Returns the value of attribute error.



25
26
27
# File 'lib/rafflesia/object_artifacts/object_artifact_cache_file_state.rb', line 25

def error
  @error
end

#existsObject

Returns the value of attribute exists.



25
26
27
# File 'lib/rafflesia/object_artifacts/object_artifact_cache_file_state.rb', line 25

def exists
  @exists
end

#expected_sha_256Object

Returns the value of attribute expected_sha_256.



25
26
27
# File 'lib/rafflesia/object_artifacts/object_artifact_cache_file_state.rb', line 25

def expected_sha_256
  @expected_sha_256
end

#expected_size_bytesObject

Returns the value of attribute expected_size_bytes.



25
26
27
# File 'lib/rafflesia/object_artifacts/object_artifact_cache_file_state.rb', line 25

def expected_size_bytes
  @expected_size_bytes
end

#is_staleObject

Returns the value of attribute is_stale.



25
26
27
# File 'lib/rafflesia/object_artifacts/object_artifact_cache_file_state.rb', line 25

def is_stale
  @is_stale
end

#local_nameObject

Returns the value of attribute local_name.



25
26
27
# File 'lib/rafflesia/object_artifacts/object_artifact_cache_file_state.rb', line 25

def local_name
  @local_name
end

#objectObject

Returns the value of attribute object.



25
26
27
# File 'lib/rafflesia/object_artifacts/object_artifact_cache_file_state.rb', line 25

def object
  @object
end

#pathObject

Returns the value of attribute path.



25
26
27
# File 'lib/rafflesia/object_artifacts/object_artifact_cache_file_state.rb', line 25

def path
  @path
end

#roleObject

Returns the value of attribute role.



25
26
27
# File 'lib/rafflesia/object_artifacts/object_artifact_cache_file_state.rb', line 25

def role
  @role
end

#sha_256Object

Returns the value of attribute sha_256.



25
26
27
# File 'lib/rafflesia/object_artifacts/object_artifact_cache_file_state.rb', line 25

def sha_256
  @sha_256
end

#shard_idObject

Returns the value of attribute shard_id.



25
26
27
# File 'lib/rafflesia/object_artifacts/object_artifact_cache_file_state.rb', line 25

def shard_id
  @shard_id
end

#size_bytesObject

Returns the value of attribute size_bytes.



25
26
27
# File 'lib/rafflesia/object_artifacts/object_artifact_cache_file_state.rb', line 25

def size_bytes
  @size_bytes
end

#statusObject

Returns the value of attribute status.



25
26
27
# File 'lib/rafflesia/object_artifacts/object_artifact_cache_file_state.rb', line 25

def status
  @status
end

#verifiedObject

Returns the value of attribute verified.



25
26
27
# File 'lib/rafflesia/object_artifacts/object_artifact_cache_file_state.rb', line 25

def verified
  @verified
end