Class: Rafflesia::ObjectMetadataData
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::ObjectMetadataData
- 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
-
#bucket ⇒ Object
Returns the value of attribute bucket.
-
#content_type ⇒ Object
Returns the value of attribute content_type.
-
#is_local ⇒ Object
Returns the value of attribute is_local.
-
#kind ⇒ Object
Returns the value of attribute kind.
-
#object_id ⇒ Object
Returns the value of attribute object_id.
-
#object_key ⇒ Object
Returns the value of attribute object_key.
-
#path ⇒ Object
Returns the value of attribute path.
-
#record_refs ⇒ Object
Returns the value of attribute record_refs.
-
#sha_256 ⇒ Object
Returns the value of attribute sha_256.
-
#size_bytes ⇒ Object
Returns the value of attribute size_bytes.
-
#storage_backend ⇒ Object
Returns the value of attribute storage_backend.
-
#uri ⇒ Object
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(json) ⇒ ObjectMetadataData
constructor
A new instance of ObjectMetadataData.
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
#bucket ⇒ Object
Returns the value of attribute bucket.
23 24 25 |
# File 'lib/rafflesia/objects/object_metadata_data.rb', line 23 def bucket @bucket end |
#content_type ⇒ Object
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_local ⇒ Object
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 |
#kind ⇒ Object
Returns the value of attribute kind.
23 24 25 |
# File 'lib/rafflesia/objects/object_metadata_data.rb', line 23 def kind @kind end |
#object_id ⇒ Object
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_key ⇒ Object
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 |
#path ⇒ Object
Returns the value of attribute path.
23 24 25 |
# File 'lib/rafflesia/objects/object_metadata_data.rb', line 23 def path @path end |
#record_refs ⇒ Object
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_256 ⇒ Object
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_bytes ⇒ Object
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_backend ⇒ Object
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 |
#uri ⇒ Object
Returns the value of attribute uri.
23 24 25 |
# File 'lib/rafflesia/objects/object_metadata_data.rb', line 23 def uri @uri end |