Class: Rafflesia::ObjectMetadataData

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/objects/object_metadata_data.rb

Constant Summary collapse

HASH_ATTRS =
{
  bucket: :bucket,
  content_type: :content_type,
  is_local: :is_local,
  kind: :kind,
  object_id: :object_id,
  object_key: :object_key,
  path: :path,
  record_refs: :record_refs,
  sha256: :sha_256,
  size_bytes: :size_bytes,
  storage_backend: :storage_backend,
  uri: :uri
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ ObjectMetadataData

Returns a new instance of ObjectMetadataData.



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/rafflesia/objects/object_metadata_data.rb', line 37

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @bucket = hash[:bucket]
  @content_type = hash[:content_type]
  @is_local = hash[:is_local]
  @kind = hash[:kind]
  @object_id = hash[:object_id]
  @object_key = hash[:object_key]
  @path = hash[:path]
  @record_refs = (hash[:record_refs] || []).map { |item| item ? Rafflesia::ObjectRecordRef.new(item) : nil }
  @sha_256 = hash[:sha256]
  @size_bytes = hash[:size_bytes]
  @storage_backend = hash[:storage_backend]
  @uri = hash[:uri]
end

Instance Attribute Details

#bucketObject

Returns the value of attribute bucket.



23
24
25
# File 'lib/rafflesia/objects/object_metadata_data.rb', line 23

def bucket
  @bucket
end

#content_typeObject

Returns the value of attribute content_type.



23
24
25
# File 'lib/rafflesia/objects/object_metadata_data.rb', line 23

def content_type
  @content_type
end

#is_localObject

Returns the value of attribute is_local.



23
24
25
# File 'lib/rafflesia/objects/object_metadata_data.rb', line 23

def is_local
  @is_local
end

#kindObject

Returns the value of attribute kind.



23
24
25
# File 'lib/rafflesia/objects/object_metadata_data.rb', line 23

def kind
  @kind
end

#object_idObject

Returns the value of attribute object_id.



23
24
25
# File 'lib/rafflesia/objects/object_metadata_data.rb', line 23

def object_id
  @object_id
end

#object_keyObject

Returns the value of attribute object_key.



23
24
25
# File 'lib/rafflesia/objects/object_metadata_data.rb', line 23

def object_key
  @object_key
end

#pathObject

Returns the value of attribute path.



23
24
25
# File 'lib/rafflesia/objects/object_metadata_data.rb', line 23

def path
  @path
end

#record_refsObject

Returns the value of attribute record_refs.



23
24
25
# File 'lib/rafflesia/objects/object_metadata_data.rb', line 23

def record_refs
  @record_refs
end

#sha_256Object

Returns the value of attribute sha_256.



23
24
25
# File 'lib/rafflesia/objects/object_metadata_data.rb', line 23

def sha_256
  @sha_256
end

#size_bytesObject

Returns the value of attribute size_bytes.



23
24
25
# File 'lib/rafflesia/objects/object_metadata_data.rb', line 23

def size_bytes
  @size_bytes
end

#storage_backendObject

Returns the value of attribute storage_backend.



23
24
25
# File 'lib/rafflesia/objects/object_metadata_data.rb', line 23

def storage_backend
  @storage_backend
end

#uriObject

Returns the value of attribute uri.



23
24
25
# File 'lib/rafflesia/objects/object_metadata_data.rb', line 23

def uri
  @uri
end