class BCP47::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/bcp47/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
BCP47::Subtag::new
# File lib/bcp47/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
BCP47::Subtag#i18n_scope
# File lib/bcp47/language.rb, line 22 def i18n_scope super << ".languages" end