lib/iso-639.rb in iso-639-0.2.3 vs lib/iso-639.rb in iso-639-0.2.4
- old
+ new
@@ -534,11 +534,11 @@
class << self
# Returns the entry array for an alpha-2 or alpha-3 code
def find_by_code(code)
case code.length
when 3
- ISO_639_2.detect { |entry| entry if entry.alpha3 == code }
+ ISO_639_2.detect { |entry| entry if entry.alpha3 == code || entry.alpha3_terminologic == code }
when 2
ISO_639_1.detect { |entry| entry if entry.alpha2 == code }
end
end
alias_method :find, :find_by_code
@@ -562,17 +562,17 @@
indexes ? ISO_639_2.values_at(*indexes).uniq : []
end
end
# The entry's alpha-3 bibliotigraphic code.
- def alpha3_bibliographic; self[0] end
+ def alpha3_bibliographic; self[0] end
alias_method :alpha3, :alpha3_bibliographic
# The entry's alpha-3 terminologic (when given)
- def alpha3_terminologic; self[1] end
+ def alpha3_terminologic; self[1] end
# The entry's alpha-2 code (when given)
- def alpha2; self[2] end
+ def alpha2; self[2] end
# The entry's english name.
- def english_name; self[3] end
+ def english_name; self[3] end
# The entry's french name.
- def french_name; self[4] end
+ def french_name; self[4] end
end