Class: ISOCodes::IndividualLanguage

Inherits:
Language
  • Object
show all
Defined in:
lib/iso_codes.rb

Instance Attribute Summary

Attributes inherited from Language

#alpha2, #alpha3_bibliographic, #alpha3_terminology, #identifier, #language_type, #reference_name

Instance Method Summary collapse

Constructor Details

#initialize(individual_languages, macrolanguage, *rest) ⇒ IndividualLanguage

Returns a new instance of IndividualLanguage.

Raises:

  • (ArgumentError)


61
62
63
64
65
66
67
# File 'lib/iso_codes.rb', line 61

def initialize(individual_languages, macrolanguage, *rest)
  super(*rest)

  raise ArgumentError, "individual languages given for individual language" if individual_languages

  @macrolanguage = macrolanguage
end

Instance Method Details

#macrolanguageObject

Returns the macrolanguage the language belongs to or nil if not part of any macrolanguage.



71
72
73
# File 'lib/iso_codes.rb', line 71

def macrolanguage
  ISOCodes::find_iso_639_3_language(@macrolanguage)
end