Class: Language

Inherits:
Object
  • Object
show all
Defined in:
lib/google_translate/language.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, code) ⇒ Language

Returns a new instance of Language.



4
5
6
7
# File 'lib/google_translate/language.rb', line 4

def initialize name, code
  @name = name
  @code = code
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



2
3
4
# File 'lib/google_translate/language.rb', line 2

def code
  @code
end

#nameObject (readonly)

Returns the value of attribute name.



2
3
4
# File 'lib/google_translate/language.rb', line 2

def name
  @name
end

Instance Method Details

#to_sObject



9
10
11
# File 'lib/google_translate/language.rb', line 9

def to_s
  "(" + code + ": " + name + ")"
end