Class: TranslationDiff::Providers::Null
- Inherits:
-
TranslationDiff::Provider
- Object
- TranslationDiff::Provider
- TranslationDiff::Providers::Null
- Defined in:
- lib/translation_diff/providers/null.rb
Overview
Hands back what it was given -- for tests, and for wiring a pipeline up before a real provider is available.
Constant Summary
Constants inherited from TranslationDiff::Provider
TranslationDiff::Provider::BARE_LANGUAGE_CODE, TranslationDiff::Provider::DEFAULT_CAPABILITIES
Instance Attribute Summary
Attributes inherited from TranslationDiff::Provider
Class Method Summary collapse
-
.capabilities ⇒ Object
Deliberately not detecting: this is the provider that proves the optional branch works.
Instance Method Summary collapse
Methods inherited from TranslationDiff::Provider
#billed_characters, build, configuration_options, configuration_requirements, #detect, #initialize, #inspect, #language, language_case, #languages, #languages_endpoint, sensitive_options
Constructor Details
This class inherits a constructor from TranslationDiff::Provider
Class Method Details
.capabilities ⇒ Object
Deliberately not detecting: this is the provider that proves the optional branch works.
4 5 6 7 8 9 |
# File 'lib/translation_diff/providers/null.rb', line 4 def self.capabilities TranslationDiff::Capabilities.new( max_request_size: 1_000_000, max_batch_size: 1_000_000, max_text_size: nil, html: :none, notranslate: false, detects_language: false, reports_billing: false ) end |
Instance Method Details
#cache_key ⇒ Object
17 |
# File 'lib/translation_diff/providers/null.rb', line 17 def cache_key = "null" |
#translate(request) ⇒ Object
11 12 13 14 15 |
# File 'lib/translation_diff/providers/null.rb', line 11 def translate(request) TranslationDiff::Translation::Response.build( request: request, texts: request.texts.map(&:to_s) ) end |