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.



297
298
299
300
301
302
# File 'lib/sendly/types.rb', line 297

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.



295
296
297
# File 'lib/sendly/types.rb', line 295

def content_type
  @content_type
end

#idObject (readonly)

Returns the value of attribute id.



295
296
297
# File 'lib/sendly/types.rb', line 295

def id
  @id
end

#size_bytesObject (readonly)

Returns the value of attribute size_bytes.



295
296
297
# File 'lib/sendly/types.rb', line 295

def size_bytes
  @size_bytes
end

#urlObject (readonly)

Returns the value of attribute url.



295
296
297
# File 'lib/sendly/types.rb', line 295

def url
  @url
end

Instance Method Details

#to_hObject



304
305
306
307
308
309
310
311
# File 'lib/sendly/types.rb', line 304

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