Module: VoiceBase::V1::Response

Defined in:
lib/voicebase/v1/response.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(response) ⇒ Object



4
5
# File 'lib/voicebase/v1/response.rb', line 4

def self.extended(response)
end

Instance Method Details

#success?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/voicebase/v1/response.rb', line 7

def success?
  ok? && request_status == "SUCCESS"
end

#transcript_ready?Boolean

Returns:

  • (Boolean)


12
13
14
15
16
17
18
19
20
# File 'lib/voicebase/v1/response.rb', line 12

def transcript_ready?

  # this was added because with the V1 API, a value in the returned JSON indicates both a
  # successful HTTP request, but also a ready transcript. With V2, there's no JSON value
  # to indicate status. Instead, the HTTP status code indicates request status, and
  # the state becoming "finished" indicates the transcript it ready.

  success?
end