Class: Google::Apis::TranslateV2::TranslationsResource

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/translate_v2/classes.rb,
generated/google/apis/translate_v2/representations.rb,
generated/google/apis/translate_v2/representations.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ TranslationsResource

Returns a new instance of TranslationsResource.


156
157
158
# File 'generated/google/apis/translate_v2/classes.rb', line 156

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#detected_source_languageString

Detected source language if source parameter is unspecified. Corresponds to the JSON property detectedSourceLanguage

Returns:

  • (String)

149
150
151
# File 'generated/google/apis/translate_v2/classes.rb', line 149

def detected_source_language
  @detected_source_language
end

#translated_textString

The translation. Corresponds to the JSON property translatedText

Returns:

  • (String)

154
155
156
# File 'generated/google/apis/translate_v2/classes.rb', line 154

def translated_text
  @translated_text
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object


161
162
163
164
# File 'generated/google/apis/translate_v2/classes.rb', line 161

def update!(**args)
  @detected_source_language = args[:detected_source_language] if args.key?(:detected_source_language)
  @translated_text = args[:translated_text] if args.key?(:translated_text)
end