class AzureSTT::Parsers::File

Parse a file from the call to the API to a Models::File

Protected Instance Methods

build_attributes() click to toggle source

Build a hash which can create a Models::File

@return [Hash] file's initializer parameters

# File lib/azure_stt/parsers/file.rb, line 16
def build_attributes
  {
    id: hash['self'].split('/').last,
    name: hash['name'],
    kind: hash['kind'],
    properties: hash['properties'],
    created_date_time: Date.parse(hash['createdDateTime']),
    content_url: hash.dig('links', 'contentUrl')
  }
end