Class: Bandwidth::BandwidthCallbackMessage
- Defined in:
- lib/bandwidth/messaging_lib/messaging/models/bandwidth_callback_message.rb
Overview
BandwidthCallbackMessage Model.
Instance Attribute Summary collapse
-
#description ⇒ String
TODO: Write general description for this method.
-
#error_code ⇒ String
TODO: Write general description for this method.
-
#message ⇒ BandwidthMessage
TODO: Write general description for this method.
-
#time ⇒ String
TODO: Write general description for this method.
-
#to ⇒ String
TODO: Write general description for this method.
-
#type ⇒ 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(time = nil, type = nil, to = nil, error_code = nil, description = nil, message = nil) ⇒ BandwidthCallbackMessage
constructor
A new instance of BandwidthCallbackMessage.
Methods inherited from BaseModel
Constructor Details
#initialize(time = nil, type = nil, to = nil, error_code = nil, description = nil, message = nil) ⇒ BandwidthCallbackMessage
Returns a new instance of BandwidthCallbackMessage.
45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/bandwidth/messaging_lib/messaging/models/bandwidth_callback_message.rb', line 45 def initialize(time = nil, type = nil, to = nil, error_code = nil, description = nil, = nil) @time = time @type = type @to = to @error_code = error_code @description = description @message = end |
Instance Attribute Details
#description ⇒ String
TODO: Write general description for this method
27 28 29 |
# File 'lib/bandwidth/messaging_lib/messaging/models/bandwidth_callback_message.rb', line 27 def description @description end |
#error_code ⇒ String
TODO: Write general description for this method
23 24 25 |
# File 'lib/bandwidth/messaging_lib/messaging/models/bandwidth_callback_message.rb', line 23 def error_code @error_code end |
#message ⇒ BandwidthMessage
TODO: Write general description for this method
31 32 33 |
# File 'lib/bandwidth/messaging_lib/messaging/models/bandwidth_callback_message.rb', line 31 def @message end |
#time ⇒ String
TODO: Write general description for this method
11 12 13 |
# File 'lib/bandwidth/messaging_lib/messaging/models/bandwidth_callback_message.rb', line 11 def time @time end |
#to ⇒ String
TODO: Write general description for this method
19 20 21 |
# File 'lib/bandwidth/messaging_lib/messaging/models/bandwidth_callback_message.rb', line 19 def to @to end |
#type ⇒ String
TODO: Write general description for this method
15 16 17 |
# File 'lib/bandwidth/messaging_lib/messaging/models/bandwidth_callback_message.rb', line 15 def type @type 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/bandwidth_callback_message.rb', line 60 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. time = hash['time'] type = hash['type'] to = hash['to'] error_code = hash['errorCode'] description = hash['description'] = BandwidthMessage.from_hash(hash['message']) if hash['message'] # Create object from extracted values. BandwidthCallbackMessage.new(time, type, to, error_code, description, ) 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/bandwidth_callback_message.rb', line 34 def self.names @_hash = {} if @_hash.nil? @_hash['time'] = 'time' @_hash['type'] = 'type' @_hash['to'] = 'to' @_hash['error_code'] = 'errorCode' @_hash['description'] = 'description' @_hash['message'] = 'message' @_hash end |