Class: Rafflesia::ObjectHeadData

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

Constant Summary collapse

HASH_ATTRS =
{
  base64: :base_64,
  content_type: :content_type,
  diagnostics: :diagnostics,
  encoding: :encoding,
  is_truncated: :is_truncated,
  limit: :limit,
  object_id: :object_id,
  returned_bytes: :returned_bytes,
  sha256: :sha_256,
  size_bytes: :size_bytes,
  text: :text
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ ObjectHeadData

Returns a new instance of ObjectHeadData.



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/rafflesia/objects/object_head_data.rb', line 35

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @base_64 = hash[:base64]
  @content_type = hash[:content_type]
  @diagnostics = hash[:diagnostics] ? Rafflesia::ObjectReadDiagnostics.new(hash[:diagnostics]) : nil
  @encoding = hash[:encoding]
  @is_truncated = hash[:is_truncated]
  @limit = hash[:limit]
  @object_id = hash[:object_id]
  @returned_bytes = hash[:returned_bytes]
  @sha_256 = hash[:sha256]
  @size_bytes = hash[:size_bytes]
  @text = hash[:text]
end

Instance Attribute Details

#base_64Object

Returns the value of attribute base_64.



22
23
24
# File 'lib/rafflesia/objects/object_head_data.rb', line 22

def base_64
  @base_64
end

#content_typeObject

Returns the value of attribute content_type.



22
23
24
# File 'lib/rafflesia/objects/object_head_data.rb', line 22

def content_type
  @content_type
end

#diagnosticsObject

Returns the value of attribute diagnostics.



22
23
24
# File 'lib/rafflesia/objects/object_head_data.rb', line 22

def diagnostics
  @diagnostics
end

#encodingObject

Returns the value of attribute encoding.



22
23
24
# File 'lib/rafflesia/objects/object_head_data.rb', line 22

def encoding
  @encoding
end

#is_truncatedObject

Returns the value of attribute is_truncated.



22
23
24
# File 'lib/rafflesia/objects/object_head_data.rb', line 22

def is_truncated
  @is_truncated
end

#limitObject

Returns the value of attribute limit.



22
23
24
# File 'lib/rafflesia/objects/object_head_data.rb', line 22

def limit
  @limit
end

#object_idObject

Returns the value of attribute object_id.



22
23
24
# File 'lib/rafflesia/objects/object_head_data.rb', line 22

def object_id
  @object_id
end

#returned_bytesObject

Returns the value of attribute returned_bytes.



22
23
24
# File 'lib/rafflesia/objects/object_head_data.rb', line 22

def returned_bytes
  @returned_bytes
end

#sha_256Object

Returns the value of attribute sha_256.



22
23
24
# File 'lib/rafflesia/objects/object_head_data.rb', line 22

def sha_256
  @sha_256
end

#size_bytesObject

Returns the value of attribute size_bytes.



22
23
24
# File 'lib/rafflesia/objects/object_head_data.rb', line 22

def size_bytes
  @size_bytes
end

#textObject

Returns the value of attribute text.



22
23
24
# File 'lib/rafflesia/objects/object_head_data.rb', line 22

def text
  @text
end