Class: DeepL::Resources::CustomTagUsageBreakdown
- Inherits:
-
Object
- Object
- DeepL::Resources::CustomTagUsageBreakdown
- Defined in:
- lib/deepl/resources/custom_tag_usage_report.rb
Overview
Usage breakdown of a custom tag. speech_to_speech_minutes is nil when the response
does not contain it.
Instance Attribute Summary collapse
-
#speech_to_speech_minutes ⇒ Object
readonly
Returns the value of attribute speech_to_speech_minutes.
-
#speech_to_text_minutes ⇒ Object
readonly
Returns the value of attribute speech_to_text_minutes.
-
#text_improvement_characters ⇒ Object
readonly
Returns the value of attribute text_improvement_characters.
-
#text_translation_characters ⇒ Object
readonly
Returns the value of attribute text_translation_characters.
-
#total_characters ⇒ Object
readonly
Returns the value of attribute total_characters.
Instance Method Summary collapse
-
#initialize(breakdown) ⇒ CustomTagUsageBreakdown
constructor
A new instance of CustomTagUsageBreakdown.
Constructor Details
#initialize(breakdown) ⇒ CustomTagUsageBreakdown
Returns a new instance of CustomTagUsageBreakdown.
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/deepl/resources/custom_tag_usage_report.rb', line 16 def initialize(breakdown) breakdown = {} unless breakdown.is_a?(Hash) @total_characters = Utils::NumberParser.count(breakdown['total_characters']) @text_translation_characters = Utils::NumberParser.count(breakdown['text_translation_characters']) @text_improvement_characters = Utils::NumberParser.count(breakdown['text_improvement_characters']) @speech_to_text_minutes = Utils::NumberParser.minutes(breakdown['speech_to_text_minutes']) @speech_to_speech_minutes = Utils::NumberParser.optional_minutes(breakdown['speech_to_speech_minutes']) end |
Instance Attribute Details
#speech_to_speech_minutes ⇒ Object (readonly)
Returns the value of attribute speech_to_speech_minutes.
12 13 14 |
# File 'lib/deepl/resources/custom_tag_usage_report.rb', line 12 def speech_to_speech_minutes @speech_to_speech_minutes end |
#speech_to_text_minutes ⇒ Object (readonly)
Returns the value of attribute speech_to_text_minutes.
12 13 14 |
# File 'lib/deepl/resources/custom_tag_usage_report.rb', line 12 def speech_to_text_minutes @speech_to_text_minutes end |
#text_improvement_characters ⇒ Object (readonly)
Returns the value of attribute text_improvement_characters.
12 13 14 |
# File 'lib/deepl/resources/custom_tag_usage_report.rb', line 12 def text_improvement_characters @text_improvement_characters end |
#text_translation_characters ⇒ Object (readonly)
Returns the value of attribute text_translation_characters.
12 13 14 |
# File 'lib/deepl/resources/custom_tag_usage_report.rb', line 12 def text_translation_characters @text_translation_characters end |
#total_characters ⇒ Object (readonly)
Returns the value of attribute total_characters.
12 13 14 |
# File 'lib/deepl/resources/custom_tag_usage_report.rb', line 12 def total_characters @total_characters end |