Class: Rafflesia::ObjectJsonGetData

Inherits:
Types::BaseModel
  • Object
show all
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

Instance Method Summary collapse

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_typeObject

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

#diagnosticsObject

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_truncatedObject

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_idObject

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

#pathObject

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_256Object

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_bytesObject

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_countObject

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

#valuesObject

Returns the value of attribute values.



20
21
22
# File 'lib/rafflesia/objects/object_json_get_data.rb', line 20

def values
  @values
end