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