Class: Rafflesia::ObjectJsonGetData
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::ObjectJsonGetData
- Defined in:
- lib/rafflesia/objects/object_json_get_data.rb
Constant Summary collapse
- HASH_ATTRS =
{ content_type: :content_type, diagnostics: :diagnostics, is_truncated: :is_truncated, object_id: :object_id, path: :path, sha256: :sha_256, size_bytes: :size_bytes, value_count: :value_count, values: :values }.freeze
Instance Attribute Summary collapse
-
#content_type ⇒ Object
Returns the value of attribute content_type.
-
#diagnostics ⇒ Object
Returns the value of attribute diagnostics.
-
#is_truncated ⇒ Object
Returns the value of attribute is_truncated.
-
#object_id ⇒ Object
Returns the value of attribute object_id.
-
#path ⇒ Object
Returns the value of attribute path.
-
#sha_256 ⇒ Object
Returns the value of attribute sha_256.
-
#size_bytes ⇒ Object
Returns the value of attribute size_bytes.
-
#value_count ⇒ Object
Returns the value of attribute value_count.
-
#values ⇒ Object
Returns the value of attribute values.
Instance Method Summary collapse
-
#initialize(json) ⇒ ObjectJsonGetData
constructor
A new instance of ObjectJsonGetData.
Constructor Details
#initialize(json) ⇒ ObjectJsonGetData
Returns a new instance of ObjectJsonGetData.
31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/rafflesia/objects/object_json_get_data.rb', line 31 def initialize(json) super() hash = self.class.normalize(json) @content_type = hash[:content_type] @diagnostics = hash[:diagnostics] ? Rafflesia::ObjectReadDiagnostics.new(hash[:diagnostics]) : nil @is_truncated = hash[:is_truncated] @object_id = hash[:object_id] @path = hash[:path] @sha_256 = hash[:sha256] @size_bytes = hash[:size_bytes] @value_count = hash[:value_count] @values = (hash[:values] || []).map { |item| item ? Rafflesia::ObjectJsonSelection.new(item) : nil } end |
Instance Attribute Details
#content_type ⇒ Object
Returns the value of attribute content_type.
20 21 22 |
# File 'lib/rafflesia/objects/object_json_get_data.rb', line 20 def content_type @content_type end |
#diagnostics ⇒ Object
Returns the value of attribute diagnostics.
20 21 22 |
# File 'lib/rafflesia/objects/object_json_get_data.rb', line 20 def diagnostics @diagnostics end |
#is_truncated ⇒ Object
Returns the value of attribute is_truncated.
20 21 22 |
# File 'lib/rafflesia/objects/object_json_get_data.rb', line 20 def is_truncated @is_truncated end |
#object_id ⇒ Object
Returns the value of attribute object_id.
20 21 22 |
# File 'lib/rafflesia/objects/object_json_get_data.rb', line 20 def object_id @object_id end |
#path ⇒ Object
Returns the value of attribute path.
20 21 22 |
# File 'lib/rafflesia/objects/object_json_get_data.rb', line 20 def path @path end |
#sha_256 ⇒ Object
Returns the value of attribute sha_256.
20 21 22 |
# File 'lib/rafflesia/objects/object_json_get_data.rb', line 20 def sha_256 @sha_256 end |
#size_bytes ⇒ Object
Returns the value of attribute size_bytes.
20 21 22 |
# File 'lib/rafflesia/objects/object_json_get_data.rb', line 20 def size_bytes @size_bytes end |
#value_count ⇒ Object
Returns the value of attribute value_count.
20 21 22 |
# File 'lib/rafflesia/objects/object_json_get_data.rb', line 20 def value_count @value_count end |
#values ⇒ Object
Returns the value of attribute values.
20 21 22 |
# File 'lib/rafflesia/objects/object_json_get_data.rb', line 20 def values @values end |