Class: DeepL::Resources::DeveloperKeyUsageLimits

Inherits:
Object
  • Object
show all
Defined in:
lib/deepl/resources/developer_key.rb

Overview

Usage limits of a developer key. A nil limit means unlimited.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(usage_limits) ⇒ DeveloperKeyUsageLimits

Returns a new instance of DeveloperKeyUsageLimits.



13
14
15
16
17
18
19
20
# File 'lib/deepl/resources/developer_key.rb', line 13

def initialize(usage_limits)
  usage_limits = {} unless usage_limits.is_a?(Hash)
  @characters = Utils::NumberParser.optional_count(usage_limits['characters'])
  @speech_to_text_milliseconds =
    Utils::NumberParser.optional_count(usage_limits['speech_to_text_milliseconds'])
  @speech_to_speech_milliseconds =
    Utils::NumberParser.optional_count(usage_limits['speech_to_speech_milliseconds'])
end

Instance Attribute Details

#characters ⇒ Object (readonly)

Returns the value of attribute characters.



11
12
13
# File 'lib/deepl/resources/developer_key.rb', line 11

def characters
  @characters
end

#speech_to_speech_milliseconds ⇒ Object (readonly)

Returns the value of attribute speech_to_speech_milliseconds.



11
12
13
# File 'lib/deepl/resources/developer_key.rb', line 11

def speech_to_speech_milliseconds
  @speech_to_speech_milliseconds
end

#speech_to_text_milliseconds ⇒ Object (readonly)

Returns the value of attribute speech_to_text_milliseconds.



11
12
13
# File 'lib/deepl/resources/developer_key.rb', line 11

def speech_to_text_milliseconds
  @speech_to_text_milliseconds
end