class Bandwidth::Media

Media Model.

Attributes

content[RW]

TODO: Write general description for this method @return [String]

content_length[RW]

TODO: Write general description for this method @return [Integer]

media_name[RW]

TODO: Write general description for this method @return [String]

Public Class Methods

from_hash(hash) click to toggle source

Creates an instance of the object from a hash.

# File lib/bandwidth/messaging_lib/messaging/models/media.rb, line 39
def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  content = hash['content']
  content_length = hash['contentLength']
  media_name = hash['mediaName']

  # Create object from extracted values.
  Media.new(content,
            content_length,
            media_name)
end
names() click to toggle source

A mapping from model property names to API property names.

# File lib/bandwidth/messaging_lib/messaging/models/media.rb, line 22
def self.names
  @_hash = {} if @_hash.nil?
  @_hash['content'] = 'content'
  @_hash['content_length'] = 'contentLength'
  @_hash['media_name'] = 'mediaName'
  @_hash
end
new(content = nil, content_length = nil, media_name = nil) click to toggle source
# File lib/bandwidth/messaging_lib/messaging/models/media.rb, line 30
def initialize(content = nil,
               content_length = nil,
               media_name = nil)
  @content = content
  @content_length = content_length
  @media_name = media_name
end