Class: Bandwidth::Transcription
- Defined in:
- lib/bandwidth/voice_lib/voice/models/transcription.rb
Overview
Transcription Model.
Instance Attribute Summary collapse
-
#completed_time ⇒ String
TODO: Write general description for this method.
-
#id ⇒ String
TODO: Write general description for this method.
-
#status ⇒ String
TODO: Write general description for this method.
-
#url ⇒ 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, url = nil, status = nil, completed_time = nil) ⇒ Transcription
constructor
A new instance of Transcription.
-
#nullables ⇒ Object
An array for nullable fields.
-
#optionals ⇒ Object
An array for optional fields.
Methods inherited from BaseModel
Constructor Details
#initialize(id = nil, url = nil, status = nil, completed_time = nil) ⇒ Transcription
Returns a new instance of Transcription.
53 54 55 56 57 58 59 60 61 |
# File 'lib/bandwidth/voice_lib/voice/models/transcription.rb', line 53 def initialize(id = nil, url = nil, status = nil, completed_time = nil) @id = id unless id == SKIP @url = url unless url == SKIP @status = status unless status == SKIP @completed_time = completed_time unless completed_time == SKIP end |
Instance Attribute Details
#completed_time ⇒ String
TODO: Write general description for this method
26 27 28 |
# File 'lib/bandwidth/voice_lib/voice/models/transcription.rb', line 26 def completed_time @completed_time end |
#id ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/bandwidth/voice_lib/voice/models/transcription.rb', line 14 def id @id end |
#status ⇒ String
TODO: Write general description for this method
22 23 24 |
# File 'lib/bandwidth/voice_lib/voice/models/transcription.rb', line 22 def status @status end |
#url ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/bandwidth/voice_lib/voice/models/transcription.rb', line 18 def url @url 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/transcription.rb', line 64 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : SKIP url = hash.key?('url') ? hash['url'] : SKIP status = hash.key?('status') ? hash['status'] : SKIP completed_time = hash.key?('completedTime') ? hash['completedTime'] : SKIP # Create object from extracted values. Transcription.new(id, url, status, completed_time) 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/transcription.rb', line 29 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['url'] = 'url' @_hash['status'] = 'status' @_hash['completed_time'] = 'completedTime' @_hash end |
Instance Method Details
#nullables ⇒ Object
An array for nullable fields
49 50 51 |
# File 'lib/bandwidth/voice_lib/voice/models/transcription.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/transcription.rb', line 39 def optionals %w[ id url status completed_time ] end |