Sha256: e35817db33001d654560695f73807e682bc5985ce95ac3f23a97d15c9b925564

Contents?: true

Size: 463 Bytes

Versions: 5

Compression:

Stored size: 463 Bytes

Contents

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

5 entries across 5 versions & 1 rubygems

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