Class: Gcloud::Translate::Language
- Inherits:
-
Object
- Object
- Gcloud::Translate::Language
- Defined in:
- lib/gcloud/translate/language.rb
Overview
# Language
Represents a supported languages query result. Returned by Api#languages.
Instance Attribute Summary collapse
-
#code ⇒ String
readonly
The language code.
-
#name ⇒ String
readonly
The localized name of the language, if available.
Class Method Summary collapse
-
.from_gapi(gapi) ⇒ Object
Google API Client object.
Instance Method Summary collapse
-
#initialize(code, name) ⇒ Language
constructor
A new instance of Language.
Constructor Details
#initialize(code, name) ⇒ Language
Returns a new instance of Language.
56 57 58 59 |
# File 'lib/gcloud/translate/language.rb', line 56 def initialize code, name @code = code @name = name end |
Instance Attribute Details
#code ⇒ String (readonly)
The language code. This is an [ISO 639-1](en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code.
46 47 48 |
# File 'lib/gcloud/translate/language.rb', line 46 def code @code end |
#name ⇒ String (readonly)
The localized name of the language, if available.
52 53 54 |
# File 'lib/gcloud/translate/language.rb', line 52 def name @name end |
Class Method Details
.from_gapi(gapi) ⇒ Object
Google API Client object.
64 65 66 |
# File 'lib/gcloud/translate/language.rb', line 64 def self.from_gapi gapi new gapi.language, gapi.name end |