class AzureSTT::Parsers::Transcription

Parse a transcription from the call to the API to a Models::Transcription

Protected Instance Methods

build_attributes() click to toggle source

Build a hash which can create a Models::Transcription

@return [Hash] transcription's initializer parameters

# File lib/azure_stt/parsers/transcription.rb, line 18
def build_attributes
  {
    id: hash['self'].split('/').last,
    model: hash.dig('model', 'self'),
    links: hash['links'],
    properties: hash['properties'],
    last_action_date_time: Date.parse(hash['lastActionDateTime']),
    created_date_time: Date.parse(hash['createdDateTime']),
    status: hash['status'],
    locale: hash['locale'],
    display_name: hash['displayName']
  }
end