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.
6 7 8 9 10 11 |
# File 'lib/deepl/resources/usage.rb', line 6 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.
4 5 6 |
# File 'lib/deepl/resources/usage.rb', line 4 def character_count @character_count end |
#character_limit ⇒ Object (readonly)
Returns the value of attribute character_limit.
4 5 6 |
# File 'lib/deepl/resources/usage.rb', line 4 def character_limit @character_limit end |
Instance Method Details
#quota_exceeded? ⇒ Boolean
17 18 19 |
# File 'lib/deepl/resources/usage.rb', line 17 def quota_exceeded? character_count >= character_limit end |
#to_s ⇒ Object
13 14 15 |
# File 'lib/deepl/resources/usage.rb', line 13 def to_s "#{character_count} / #{character_limit}" end |