class ISO::Language

Constants

DEFAULT_CODE
DEFAULT_DIRECTION
DEFAULT_PLURAL_RULE_NAMES
DEFINITIONS_FILE
PLURAL_RULE_NAMES

Attributes

direction[R]
plural_rule_names[R]

Public Class Methods

identify(full_code) click to toggle source
# File lib/iso/language.rb, line 16
def self.identify(full_code)
  segments = full_code.split('-')
  segments.first =~ /^([a-z]{2})$/ ? find($1) : nil
end
new(code, options={}) click to toggle source
Calls superclass method ISO::Subtag::new
# File lib/iso/language.rb, line 10
def initialize(code, options={})
  @plural_rule_names = options[:plural_rule_names] || DEFAULT_PLURAL_RULE_NAMES
  @direction         = options[:direction]         || DEFAULT_DIRECTION
  super(code, options)
end

Private Instance Methods

i18n_scope() click to toggle source
Calls superclass method ISO::Subtag#i18n_scope
# File lib/iso/language.rb, line 22
def i18n_scope
  super << ".languages"
end