class Idioma::Configuration

Attributes

default_locale[RW]
ignore_keys[RW]
locales[W]
redis_backend[RW]

Public Class Methods

new() click to toggle source
# File lib/idioma.rb, line 9
def initialize
  self.default_locale = :en
  self.locales = [self.default_locale]
  self.ignore_keys = ["ransack", "simple_form"]
end

Public Instance Methods

default_locale() click to toggle source
# File lib/idioma.rb, line 19
def default_locale
  proc_or_value(@default_locale)
end
locales() click to toggle source
# File lib/idioma.rb, line 15
def locales
  proc_or_value(@locales)
end

Private Instance Methods

proc_or_value(var) click to toggle source
# File lib/idioma.rb, line 25
def proc_or_value(var)
  case
  when var.is_a?(Proc)
    var.call
  else
    var
  end
end