Class: Voltron::Config::Translate

Inherits:
Object
  • Object
show all
Defined in:
lib/voltron/config/translate.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTranslate

Returns a new instance of Translate.



12
13
14
15
16
# File 'lib/voltron/config/translate.rb', line 12

def initialize
  @build_environment ||= [:development]
  @enabled ||= true
  @locales ||= I18n.available_locales
end

Instance Attribute Details

#build_environmentObject

Returns the value of attribute build_environment.



10
11
12
# File 'lib/voltron/config/translate.rb', line 10

def build_environment
  @build_environment
end

#enabledObject

Returns the value of attribute enabled.



10
11
12
# File 'lib/voltron/config/translate.rb', line 10

def enabled
  @enabled
end

#localesObject

Returns the value of attribute locales.



10
11
12
# File 'lib/voltron/config/translate.rb', line 10

def locales
  @locales
end

Instance Method Details

#buildable?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/voltron/config/translate.rb', line 22

def buildable?
  Array.wrap(build_environment).map(&:to_s).include?(Rails.env.to_s)
end

#enabled?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/voltron/config/translate.rb', line 18

def enabled?
  enabled == true
end