Class: Bandwidth::BandwidthMessage
- Defined in:
- lib/bandwidth/messaging_lib/messaging/models/bandwidth_message.rb
Overview
BandwidthMessage Model.
Instance Attribute Summary collapse
-
#application_id ⇒ String
TODO: Write general description for this method.
-
#direction ⇒ String
TODO: Write general description for this method.
-
#from ⇒ String
TODO: Write general description for this method.
-
#id ⇒ String
TODO: Write general description for this method.
-
#media ⇒ List of String
TODO: Write general description for this method.
-
#owner ⇒ String
TODO: Write general description for this method.
-
#segment_count ⇒ Integer
TODO: Write general description for this method.
-
#tag ⇒ String
TODO: Write general description for this method.
-
#text ⇒ String
TODO: Write general description for this method.
-
#time ⇒ String
TODO: Write general description for this method.
-
#to ⇒ List of String
TODO: Write general description for this method.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
Instance Method Summary collapse
-
#initialize(id = nil, owner = nil, application_id = nil, time = nil, segment_count = nil, direction = nil, to = nil, from = nil, media = nil, text = nil, tag = nil) ⇒ BandwidthMessage
constructor
A new instance of BandwidthMessage.
Methods inherited from BaseModel
Constructor Details
#initialize(id = nil, owner = nil, application_id = nil, time = nil, segment_count = nil, direction = nil, to = nil, from = nil, media = nil, text = nil, tag = nil) ⇒ BandwidthMessage
Returns a new instance of BandwidthMessage.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/bandwidth/messaging_lib/messaging/models/bandwidth_message.rb', line 70 def initialize(id = nil, owner = nil, application_id = nil, time = nil, segment_count = nil, direction = nil, to = nil, from = nil, media = nil, text = nil, tag = nil) @id = id @owner = owner @application_id = application_id @time = time @segment_count = segment_count @direction = direction @to = to @from = from @media = media @text = text @tag = tag end |
Instance Attribute Details
#application_id ⇒ String
TODO: Write general description for this method
19 20 21 |
# File 'lib/bandwidth/messaging_lib/messaging/models/bandwidth_message.rb', line 19 def application_id @application_id end |
#direction ⇒ String
TODO: Write general description for this method
31 32 33 |
# File 'lib/bandwidth/messaging_lib/messaging/models/bandwidth_message.rb', line 31 def direction @direction end |
#from ⇒ String
TODO: Write general description for this method
39 40 41 |
# File 'lib/bandwidth/messaging_lib/messaging/models/bandwidth_message.rb', line 39 def from @from end |
#id ⇒ String
TODO: Write general description for this method
11 12 13 |
# File 'lib/bandwidth/messaging_lib/messaging/models/bandwidth_message.rb', line 11 def id @id end |
#media ⇒ List of String
TODO: Write general description for this method
43 44 45 |
# File 'lib/bandwidth/messaging_lib/messaging/models/bandwidth_message.rb', line 43 def media @media end |
#owner ⇒ String
TODO: Write general description for this method
15 16 17 |
# File 'lib/bandwidth/messaging_lib/messaging/models/bandwidth_message.rb', line 15 def owner @owner end |
#segment_count ⇒ Integer
TODO: Write general description for this method
27 28 29 |
# File 'lib/bandwidth/messaging_lib/messaging/models/bandwidth_message.rb', line 27 def segment_count @segment_count end |
#tag ⇒ String
TODO: Write general description for this method
51 52 53 |
# File 'lib/bandwidth/messaging_lib/messaging/models/bandwidth_message.rb', line 51 def tag @tag end |
#text ⇒ String
TODO: Write general description for this method
47 48 49 |
# File 'lib/bandwidth/messaging_lib/messaging/models/bandwidth_message.rb', line 47 def text @text end |
#time ⇒ String
TODO: Write general description for this method
23 24 25 |
# File 'lib/bandwidth/messaging_lib/messaging/models/bandwidth_message.rb', line 23 def time @time end |
#to ⇒ List of String
TODO: Write general description for this method
35 36 37 |
# File 'lib/bandwidth/messaging_lib/messaging/models/bandwidth_message.rb', line 35 def to @to end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/bandwidth/messaging_lib/messaging/models/bandwidth_message.rb', line 95 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash['id'] owner = hash['owner'] application_id = hash['applicationId'] time = hash['time'] segment_count = hash['segmentCount'] direction = hash['direction'] to = hash['to'] from = hash['from'] media = hash['media'] text = hash['text'] tag = hash['tag'] # Create object from extracted values. BandwidthMessage.new(id, owner, application_id, time, segment_count, direction, to, from, media, text, tag) end |
.names ⇒ Object
A mapping from model property names to API property names.
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/bandwidth/messaging_lib/messaging/models/bandwidth_message.rb', line 54 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['owner'] = 'owner' @_hash['application_id'] = 'applicationId' @_hash['time'] = 'time' @_hash['segment_count'] = 'segmentCount' @_hash['direction'] = 'direction' @_hash['to'] = 'to' @_hash['from'] = 'from' @_hash['media'] = 'media' @_hash['text'] = 'text' @_hash['tag'] = 'tag' @_hash end |