Class: DeepL::Resources::Usage
- Defined in:
- lib/deepl/resources/usage.rb
Instance Attribute Summary collapse
-
#character_count ⇒ Object
readonly
Returns the value of attribute character_count.
-
#character_limit ⇒ Object
readonly
Returns the value of attribute character_limit.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(character_count, character_limit, *args) ⇒ Usage
constructor
A new instance of Usage.
- #quota_exceeded? ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(character_count, character_limit, *args) ⇒ Usage
Returns a new instance of Usage.
8 9 10 11 12 13 |
# File 'lib/deepl/resources/usage.rb', line 8 def initialize(character_count, character_limit, *args) super(*args) @character_count = character_count @character_limit = character_limit end |
Instance Attribute Details
#character_count ⇒ Object (readonly)
Returns the value of attribute character_count.
6 7 8 |
# File 'lib/deepl/resources/usage.rb', line 6 def character_count @character_count end |
#character_limit ⇒ Object (readonly)
Returns the value of attribute character_limit.
6 7 8 |
# File 'lib/deepl/resources/usage.rb', line 6 def character_limit @character_limit end |
Instance Method Details
#quota_exceeded? ⇒ Boolean
19 20 21 |
# File 'lib/deepl/resources/usage.rb', line 19 def quota_exceeded? character_count >= character_limit end |
#to_s ⇒ Object
15 16 17 |
# File 'lib/deepl/resources/usage.rb', line 15 def to_s "#{character_count} / #{character_limit}" end |