Class: Bandwidth::Diversion
- Defined in:
- lib/bandwidth/voice_lib/voice/models/diversion.rb
Overview
Diversion Model.
Instance Attribute Summary collapse
-
#orig_to ⇒ String
TODO: Write general description for this method.
-
#privacy ⇒ String
TODO: Write general description for this method.
-
#reason ⇒ String
TODO: Write general description for this method.
-
#unknown ⇒ 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(reason = nil, privacy = nil, unknown = nil, orig_to = nil) ⇒ Diversion
constructor
A new instance of Diversion.
-
#nullables ⇒ Object
An array for nullable fields.
-
#optionals ⇒ Object
An array for optional fields.
Methods inherited from BaseModel
Constructor Details
#initialize(reason = nil, privacy = nil, unknown = nil, orig_to = nil) ⇒ Diversion
Returns a new instance of Diversion.
53 54 55 56 57 58 59 60 61 |
# File 'lib/bandwidth/voice_lib/voice/models/diversion.rb', line 53 def initialize(reason = nil, privacy = nil, unknown = nil, orig_to = nil) @reason = reason unless reason == SKIP @privacy = privacy unless privacy == SKIP @unknown = unknown unless unknown == SKIP @orig_to = orig_to unless orig_to == SKIP end |
Instance Attribute Details
#orig_to ⇒ String
TODO: Write general description for this method
26 27 28 |
# File 'lib/bandwidth/voice_lib/voice/models/diversion.rb', line 26 def orig_to @orig_to end |
#privacy ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/bandwidth/voice_lib/voice/models/diversion.rb', line 18 def privacy @privacy end |
#reason ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/bandwidth/voice_lib/voice/models/diversion.rb', line 14 def reason @reason end |
#unknown ⇒ String
TODO: Write general description for this method
22 23 24 |
# File 'lib/bandwidth/voice_lib/voice/models/diversion.rb', line 22 def unknown @unknown end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/bandwidth/voice_lib/voice/models/diversion.rb', line 64 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. reason = hash.key?('reason') ? hash['reason'] : SKIP privacy = hash.key?('privacy') ? hash['privacy'] : SKIP unknown = hash.key?('unknown') ? hash['unknown'] : SKIP orig_to = hash.key?('origTo') ? hash['origTo'] : SKIP # Create object from extracted values. Diversion.new(reason, privacy, unknown, orig_to) end |
.names ⇒ Object
A mapping from model property names to API property names.
29 30 31 32 33 34 35 36 |
# File 'lib/bandwidth/voice_lib/voice/models/diversion.rb', line 29 def self.names @_hash = {} if @_hash.nil? @_hash['reason'] = 'reason' @_hash['privacy'] = 'privacy' @_hash['unknown'] = 'unknown' @_hash['orig_to'] = 'origTo' @_hash end |
Instance Method Details
#nullables ⇒ Object
An array for nullable fields
49 50 51 |
# File 'lib/bandwidth/voice_lib/voice/models/diversion.rb', line 49 def nullables [] end |
#optionals ⇒ Object
An array for optional fields
39 40 41 42 43 44 45 46 |
# File 'lib/bandwidth/voice_lib/voice/models/diversion.rb', line 39 def optionals %w[ reason privacy unknown orig_to ] end |