Sha256: 5ce09d81ee02afd9df4754df5ea1019d2e15a4bd518e87dee2aeff8352b70501
Contents?: true
Size: 1.11 KB
Versions: 1
Compression:
Stored size: 1.11 KB
Contents
module VoiceBase module V2 module Response TRANSCRIPT_READY_STATUS = "finished".freeze def success? # for the V1 API this indicates both a successful HTTP status code and a values of "SUCCESS" in the # returned JSON. with V2, there is no "SUCCESS" value. The combined use was split, adding # #transcript_ready? to both interfaces. ok? end def media_id voicebase_response['mediaId'] end def transcript_ready? voicebase_response['media']['status'].casecmp(TRANSCRIPT_READY_STATUS) == 0 end def transcript # this retrieves the JSON transcript only # the plain text transcript is a plain text non-JSON response voicebase_response['media']['transcripts']['latest']['words'] end def keywords voicebase_response['media']['transcripts']['latest']['keywords'] end def topics voicebase_response['media']['transcripts']['latest']['topics'] end private def voicebase_response http_response.parsed_response end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
voicebase-client-ruby-1.1.0 | lib/voicebase/v2/response.rb |