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.
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_type ⇒ Object (readonly)
Returns the value of attribute content_type.
216 217 218 |
# File 'lib/sendly/types.rb', line 216 def content_type @content_type end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
216 217 218 |
# File 'lib/sendly/types.rb', line 216 def id @id end |
#size_bytes ⇒ Object (readonly)
Returns the value of attribute size_bytes.
216 217 218 |
# File 'lib/sendly/types.rb', line 216 def size_bytes @size_bytes end |
#url ⇒ Object (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_h ⇒ Object
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 |