Sha256: 916b75200a892422d096385a2c5c71e5762b05c566fa8a1bb32f5fecb0e48df5

Contents?: true

Size: 649 Bytes

Versions: 5

Compression:

Stored size: 649 Bytes

Contents

# frozen_string_literal: true

module AzureSTT
  module Parsers
    #
    # Parse a file from the call to the API to a Models::File
    #
    class File < Base
      protected

      #
      # Build a hash which can create a Models::File
      #
      # @return [Hash] file's initializer parameters
      #
      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
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
azure_stt-0.4.0 lib/azure_stt/parsers/file.rb
azure_stt-0.3.0 lib/azure_stt/parsers/file.rb
azure_stt-0.2.0 lib/azure_stt/parsers/file.rb
azure_stt-0.1.1 lib/azure_stt/parsers/file.rb
azure_stt-0.1.0 lib/azure_stt/parsers/file.rb