Module: Alchemy::Language::Code

Extended by:
ActiveSupport::Concern
Included in:
Alchemy::Language
Defined in:
app/models/alchemy/language/code.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#codeObject



4
5
6
# File 'app/models/alchemy/language/code.rb', line 4

def code
  [language_code, country_code].select(&:present?).join('-')
end

#code=(code) ⇒ Object



8
9
10
# File 'app/models/alchemy/language/code.rb', line 8

def code=(code)
  self.language_code = code
end