Class: Rafflesia::ObjectDownloadData

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

Constant Summary collapse

HASH_ATTRS =
{
  content_length_bytes: :content_length_bytes,
  object: :object,
  resolved_url: :resolved_url,
  retrieved_at: :retrieved_at,
  url: :url
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ ObjectDownloadData

Returns a new instance of ObjectDownloadData.



23
24
25
26
27
28
29
30
31
# File 'lib/rafflesia/objects/object_download_data.rb', line 23

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @content_length_bytes = hash[:content_length_bytes]
  @object = hash[:object] ? Rafflesia::ObjectRef.new(hash[:object]) : nil
  @resolved_url = hash[:resolved_url]
  @retrieved_at = hash[:retrieved_at]
  @url = hash[:url]
end

Instance Attribute Details

#content_length_bytesObject

Returns the value of attribute content_length_bytes.



16
17
18
# File 'lib/rafflesia/objects/object_download_data.rb', line 16

def content_length_bytes
  @content_length_bytes
end

#objectObject

Returns the value of attribute object.



16
17
18
# File 'lib/rafflesia/objects/object_download_data.rb', line 16

def object
  @object
end

#resolved_urlObject

Returns the value of attribute resolved_url.



16
17
18
# File 'lib/rafflesia/objects/object_download_data.rb', line 16

def resolved_url
  @resolved_url
end

#retrieved_atObject

Returns the value of attribute retrieved_at.



16
17
18
# File 'lib/rafflesia/objects/object_download_data.rb', line 16

def retrieved_at
  @retrieved_at
end

#urlObject

Returns the value of attribute url.



16
17
18
# File 'lib/rafflesia/objects/object_download_data.rb', line 16

def url
  @url
end