Class: Bandwidth::MessageRequest
- Defined in:
- lib/bandwidth/messaging_lib/messaging/models/message_request.rb
Overview
MessageRequest Model.
Instance Attribute Summary collapse
-
#application_id ⇒ String
TODO: Write general description for this method.
-
#from ⇒ String
TODO: Write general description for this method.
-
#media ⇒ List of String
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.
-
#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(application_id = nil, to = nil, from = nil, text = nil, media = nil, tag = nil) ⇒ MessageRequest
constructor
A new instance of MessageRequest.
Methods inherited from BaseModel
Constructor Details
#initialize(application_id = nil, to = nil, from = nil, text = nil, media = nil, tag = nil) ⇒ MessageRequest
Returns a new instance of MessageRequest.
45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/bandwidth/messaging_lib/messaging/models/message_request.rb', line 45 def initialize(application_id = nil, to = nil, from = nil, text = nil, media = nil, tag = nil) @application_id = application_id @to = to @from = from @text = text @media = media @tag = tag end |
Instance Attribute Details
#application_id ⇒ String
TODO: Write general description for this method
11 12 13 |
# File 'lib/bandwidth/messaging_lib/messaging/models/message_request.rb', line 11 def application_id @application_id end |
#from ⇒ String
TODO: Write general description for this method
19 20 21 |
# File 'lib/bandwidth/messaging_lib/messaging/models/message_request.rb', line 19 def from @from end |
#media ⇒ List of String
TODO: Write general description for this method
27 28 29 |
# File 'lib/bandwidth/messaging_lib/messaging/models/message_request.rb', line 27 def media @media end |
#tag ⇒ String
TODO: Write general description for this method
31 32 33 |
# File 'lib/bandwidth/messaging_lib/messaging/models/message_request.rb', line 31 def tag @tag end |
#text ⇒ String
TODO: Write general description for this method
23 24 25 |
# File 'lib/bandwidth/messaging_lib/messaging/models/message_request.rb', line 23 def text @text end |
#to ⇒ List of String
TODO: Write general description for this method
15 16 17 |
# File 'lib/bandwidth/messaging_lib/messaging/models/message_request.rb', line 15 def to @to end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/bandwidth/messaging_lib/messaging/models/message_request.rb', line 60 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. application_id = hash['applicationId'] to = hash['to'] from = hash['from'] text = hash['text'] media = hash['media'] tag = hash['tag'] # Create object from extracted values. MessageRequest.new(application_id, to, from, text, media, tag) end |
.names ⇒ Object
A mapping from model property names to API property names.
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/bandwidth/messaging_lib/messaging/models/message_request.rb', line 34 def self.names @_hash = {} if @_hash.nil? @_hash['application_id'] = 'applicationId' @_hash['to'] = 'to' @_hash['from'] = 'from' @_hash['text'] = 'text' @_hash['media'] = 'media' @_hash['tag'] = 'tag' @_hash end |