class BabelishRnc::Language

Attributes

code[RW]
content[RW]
name[RW]
regions[RW]

Public Class Methods

new(name, content = {}) click to toggle source
# File lib/babelish_rnc/language.rb, line 5
def initialize(name, content = {})
  @name = name
  @content = content
end

Public Instance Methods

add_content_pair(key, value) click to toggle source
# File lib/babelish_rnc/language.rb, line 10
def add_content_pair(key, value)
  @content[key] = value
end
add_language_id(language_id) click to toggle source
# File lib/babelish_rnc/language.rb, line 14
def add_language_id(language_id)
  code, region = language_id.split('-')
  @code ||= code
  @regions ||= []
  @regions << region if region
end
content_for_key(key) click to toggle source
# File lib/babelish_rnc/language.rb, line 25
def content_for_key(key)
  return @content[:key]
end
region() click to toggle source
# File lib/babelish_rnc/language.rb, line 21
def region
  @regions.first
end