Sha256: 22de94cad221eb8cc5acb0f38145ca6c3e445e48eaa9255726fcaed82db37d2c

Contents?: true

Size: 484 Bytes

Versions: 9

Compression:

Stored size: 484 Bytes

Contents

# frozen_string_literal: true

module DeepL
  module Requests
    class Usage < Base
      def initialize(api, options = {})
        super(api, options)
      end

      def request
        build_usage(*get)
      end

      private

      def build_usage(request, response)
        data = JSON.parse(response.body)
        Resources::Usage.new(data['character_count'], data['character_limit'], request, response)
      end

      def path
        'usage'
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
deepl-rb-2.5.3 lib/deepl/requests/usage.rb
deepl-rb-2.5.2 lib/deepl/requests/usage.rb
deepl-rb-2.5.1 lib/deepl/requests/usage.rb
deepl-rb-2.5.0 lib/deepl/requests/usage.rb
deepl-rb-2.4.0 lib/deepl/requests/usage.rb
deepl-rb-2.3.1 lib/deepl/requests/usage.rb
deepl-rb-2.3.0 lib/deepl/requests/usage.rb
deepl-rb-2.2.4 lib/deepl/requests/usage.rb
deepl-rb-2.2.3 lib/deepl/requests/usage.rb