Class | Webgen::Language |
In: |
lib/webgen/languages.rb
|
Parent: | Object |
Describes a human language which is uniquely identfied by a three letter code and, optionally, by an alternative three letter or a two letter code.
codes | [R] | |
description | [R] |
Creates a new language. codes has to be an array containing three strings: the three letter code, the alternative three letter code and the two letter code. If one is not available for the language, it has to be nil.
# File lib/webgen/languages.rb, line 39 39: def initialize( codes, description ) 40: @codes = codes 41: @description = description 42: end
The two letter code.
# File lib/webgen/languages.rb, line 45 45: def code2chars 46: @codes[2] 47: end
The three letter code.
# File lib/webgen/languages.rb, line 50 50: def code3chars 51: @codes[0] 52: end
The alternative three letter code.
# File lib/webgen/languages.rb, line 55 55: def code3chars_alternative 56: @codes[1] 57: end
# File lib/webgen/languages.rb, line 66 66: def inspect 67: "#<Language codes=#{codes.inspect} description=#{description.inspect}" 68: end