Class: ISOCodes::Language
- Inherits:
-
Object
- Object
- ISOCodes::Language
- Defined in:
- lib/iso_codes.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#alpha2 ⇒ Object
readonly
ISO 639-1 identifier for the language, or
nil
if none is defined. -
#alpha3_bibliographic ⇒ Object
readonly
ISO 639-2 identifier of the bibliographic applications code set for the language, or
nil
if none is defined. -
#alpha3_terminology ⇒ Object
readonly
ISO 639-2 identifier of the terminology applications code set for the language, or
nil
if none is defined. -
#identifier ⇒ Object
readonly
ISO 639-3 identifier for the language, or
nil
if none is defined. -
#language_type ⇒ Object
readonly
Language type for the language.
-
#reference_name ⇒ Object
readonly
Reference name for the language.
Instance Method Summary collapse
-
#initialize(identifier, part2b, part2t, part1, language_type, ref_name) ⇒ Language
constructor
A new instance of Language.
Constructor Details
#initialize(identifier, part2b, part2t, part1, language_type, ref_name) ⇒ Language
Returns a new instance of Language.
34 35 36 37 38 39 40 41 |
# File 'lib/iso_codes.rb', line 34 def initialize(identifier, part2b, part2t, part1, language_type, ref_name) @identifier = identifier @alpha3_bibliographic = part2b == '' ? nil : part2b @alpha3_terminology = part2t == '' ? nil : part2t @alpha2 = part1 == '' ? nil : part1 @language_type = language_type @reference_name = ref_name end |
Instance Attribute Details
#alpha2 ⇒ Object (readonly)
ISO 639-1 identifier for the language, or nil
if none is defined.
23 24 25 |
# File 'lib/iso_codes.rb', line 23 def alpha2 @alpha2 end |
#alpha3_bibliographic ⇒ Object (readonly)
ISO 639-2 identifier of the bibliographic applications code set for the language, or nil
if none is defined.
16 17 18 |
# File 'lib/iso_codes.rb', line 16 def alpha3_bibliographic @alpha3_bibliographic end |
#alpha3_terminology ⇒ Object (readonly)
ISO 639-2 identifier of the terminology applications code set for the language, or nil
if none is defined.
20 21 22 |
# File 'lib/iso_codes.rb', line 20 def alpha3_terminology @alpha3_terminology end |
#identifier ⇒ Object (readonly)
ISO 639-3 identifier for the language, or nil
if none is defined.
12 13 14 |
# File 'lib/iso_codes.rb', line 12 def identifier @identifier end |
#language_type ⇒ Object (readonly)
Language type for the language. Language type is either :living
, :extinct
, :ancient
, :historic
, :constructed
, or :special
. See www.sil.org/iso639-3/types.asp for a description.
29 30 31 |
# File 'lib/iso_codes.rb', line 29 def language_type @language_type end |
#reference_name ⇒ Object (readonly)
Reference name for the language.
32 33 34 |
# File 'lib/iso_codes.rb', line 32 def reference_name @reference_name end |