Sha256: 3da16ed4070456dec57552d672e3191635d48d4ed314458fc94dc701cc5729ef

Contents?: true

Size: 494 Bytes

Versions: 9

Compression:

Stored size: 494 Bytes

Contents

# frozen_string_literal: true

module DeepL
  module Resources
    class Usage < Base
      attr_reader :character_count, :character_limit

      def initialize(character_count, character_limit, *args)
        super(*args)

        @character_count = character_count
        @character_limit = character_limit
      end

      def to_s
        "#{character_count} / #{character_limit}"
      end

      def quota_exceeded?
        character_count >= character_limit
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

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