Class: Sendly::MediaFile
- Inherits:
-
Object
- Object
- Sendly::MediaFile
- Defined in:
- lib/sendly/types.rb
Overview
============================================================================
Media
Instance Attribute Summary collapse
-
#content_type ⇒ Object
readonly
Returns the value of attribute content_type.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#size_bytes ⇒ Object
readonly
Returns the value of attribute size_bytes.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(data) ⇒ MediaFile
constructor
A new instance of MediaFile.
- #to_h ⇒ Object
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_type ⇒ Object (readonly)
Returns the value of attribute content_type.
295 296 297 |
# File 'lib/sendly/types.rb', line 295 def content_type @content_type end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
295 296 297 |
# File 'lib/sendly/types.rb', line 295 def id @id end |
#size_bytes ⇒ Object (readonly)
Returns the value of attribute size_bytes.
295 296 297 |
# File 'lib/sendly/types.rb', line 295 def size_bytes @size_bytes end |
#url ⇒ Object (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_h ⇒ Object
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 |