Class: Sendly::MediaFile

Inherits:
Object
  • Object
show all
Defined in:
lib/sendly/types.rb

Overview

Media

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ MediaFile

Returns a new instance of MediaFile.



218
219
220
221
222
223
# File 'lib/sendly/types.rb', line 218

def initialize(data)
  @id = data["id"]
  @url = data["url"]
  @content_type = data["contentType"]
  @size_bytes = data["sizeBytes"]
end

Instance Attribute Details

#content_typeObject (readonly)

Returns the value of attribute content_type.



216
217
218
# File 'lib/sendly/types.rb', line 216

def content_type
  @content_type
end

#idObject (readonly)

Returns the value of attribute id.



216
217
218
# File 'lib/sendly/types.rb', line 216

def id
  @id
end

#size_bytesObject (readonly)

Returns the value of attribute size_bytes.



216
217
218
# File 'lib/sendly/types.rb', line 216

def size_bytes
  @size_bytes
end

#urlObject (readonly)

Returns the value of attribute url.



216
217
218
# File 'lib/sendly/types.rb', line 216

def url
  @url
end

Instance Method Details

#to_hObject



225
226
227
228
229
230
231
232
# File 'lib/sendly/types.rb', line 225

def to_h
  {
    id: id,
    url: url,
    content_type: content_type,
    size_bytes: size_bytes
  }.compact
end