Class: Iso639::Language
- Inherits:
-
Object
- Object
- Iso639::Language
- Defined in:
- lib/iso639/language.rb
Instance Attribute Summary collapse
-
#alpha2 ⇒ Object
readonly
Returns the value of attribute alpha2.
-
#alpha3_bibliographic ⇒ Object
(also: #alpha3)
readonly
Returns the value of attribute alpha3_bibliographic.
-
#alpha3_terminology ⇒ Object
readonly
Returns the value of attribute alpha3_terminology.
-
#english_names ⇒ Object
readonly
Returns the value of attribute english_names.
-
#french_names ⇒ Object
readonly
Returns the value of attribute french_names.
Instance Method Summary collapse
- #english_name ⇒ Object (also: #name, #to_s)
- #french_name ⇒ Object
-
#initialize(alpha3_bibliographic, alpha3_terminology, alpha2, english_names, french_names) ⇒ Language
constructor
Public: Initialize a Language.
Constructor Details
#initialize(alpha3_bibliographic, alpha3_terminology, alpha2, english_names, french_names) ⇒ Language
Public: Initialize a Language.
alpha3_bibliographic - A String representing the alpha-3 bibliographic code alpha3_terminology - A String representing the alpha-3 terminology code alpha2 - A String representing the alpha-2 code english_names - A String representing the English names (semi-colon delimited) french_names - A String representing the French names (semi-colon delimited)
13 14 15 16 17 18 19 |
# File 'lib/iso639/language.rb', line 13 def initialize(alpha3_bibliographic, alpha3_terminology, alpha2, english_names, french_names) @alpha3_bibliographic = strip_to_nil(alpha3_bibliographic) @alpha3_terminology = strip_to_nil(alpha3_terminology) || @alpha3_bibliographic @alpha2 = strip_to_nil(alpha2) @english_names = split_and_strip(english_names) @french_names = split_and_strip(french_names) end |
Instance Attribute Details
#alpha2 ⇒ Object (readonly)
Returns the value of attribute alpha2.
3 4 5 |
# File 'lib/iso639/language.rb', line 3 def alpha2 @alpha2 end |
#alpha3_bibliographic ⇒ Object (readonly) Also known as: alpha3
Returns the value of attribute alpha3_bibliographic.
3 4 5 |
# File 'lib/iso639/language.rb', line 3 def alpha3_bibliographic @alpha3_bibliographic end |
#alpha3_terminology ⇒ Object (readonly)
Returns the value of attribute alpha3_terminology.
3 4 5 |
# File 'lib/iso639/language.rb', line 3 def alpha3_terminology @alpha3_terminology end |
#english_names ⇒ Object (readonly)
Returns the value of attribute english_names.
3 4 5 |
# File 'lib/iso639/language.rb', line 3 def english_names @english_names end |
#french_names ⇒ Object (readonly)
Returns the value of attribute french_names.
3 4 5 |
# File 'lib/iso639/language.rb', line 3 def french_names @french_names end |
Instance Method Details
#english_name ⇒ Object Also known as: name, to_s
21 22 23 |
# File 'lib/iso639/language.rb', line 21 def english_name english_names.first end |
#french_name ⇒ Object
27 28 29 |
# File 'lib/iso639/language.rb', line 27 def french_name french_names.first end |