Sha256: 7e04106481611fed284284a5b2e985b98946a2ab26da1a35603901f8d11d3197

Contents?: true

Size: 453 Bytes

Versions: 5

Compression:

Stored size: 453 Bytes

Contents

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

5 entries across 5 versions & 1 rubygems

Version Path
deepl-rb-2.2.2 lib/deepl/requests/usage.rb
deepl-rb-2.2.1 lib/deepl/requests/usage.rb
deepl-rb-2.2.0 lib/deepl/requests/usage.rb
deepl-rb-2.1.0 lib/deepl/requests/usage.rb
deepl-rb-2.0.0 lib/deepl/requests/usage.rb