Class: Bandwidth::Transcription

Inherits:
BaseModel show all
Defined in:
lib/bandwidth/voice_lib/voice/models/transcription.rb

Overview

Transcription Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(id = nil, status = nil, completed_time = nil, url = nil) ⇒ Transcription

Returns a new instance of Transcription.



35
36
37
38
39
40
41
42
43
# File 'lib/bandwidth/voice_lib/voice/models/transcription.rb', line 35

def initialize(id = nil,
               status = nil,
               completed_time = nil,
               url = nil)
  @id = id
  @status = status
  @completed_time = completed_time
  @url = url
end

Instance Attribute Details

#completed_timeString

TODO: Write general description for this method

Returns:

  • (String)


19
20
21
# File 'lib/bandwidth/voice_lib/voice/models/transcription.rb', line 19

def completed_time
  @completed_time
end

#idString

TODO: Write general description for this method

Returns:

  • (String)


11
12
13
# File 'lib/bandwidth/voice_lib/voice/models/transcription.rb', line 11

def id
  @id
end

#statusStatus1Enum

TODO: Write general description for this method

Returns:



15
16
17
# File 'lib/bandwidth/voice_lib/voice/models/transcription.rb', line 15

def status
  @status
end

#urlString

TODO: Write general description for this method

Returns:

  • (String)


23
24
25
# File 'lib/bandwidth/voice_lib/voice/models/transcription.rb', line 23

def url
  @url
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/bandwidth/voice_lib/voice/models/transcription.rb', line 46

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  id = hash['id']
  status = hash['status']
  completed_time = hash['completedTime']
  url = hash['url']

  # Create object from extracted values.
  Transcription.new(id,
                    status,
                    completed_time,
                    url)
end

.namesObject

A mapping from model property names to API property names.



26
27
28
29
30
31
32
33
# File 'lib/bandwidth/voice_lib/voice/models/transcription.rb', line 26

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['id'] = 'id'
  @_hash['status'] = 'status'
  @_hash['completed_time'] = 'completedTime'
  @_hash['url'] = 'url'
  @_hash
end