Class: Voltron::Config::Translate
- Inherits:
-
Object
- Object
- Voltron::Config::Translate
- Defined in:
- lib/voltron/config/translate.rb
Instance Attribute Summary collapse
-
#build_environment ⇒ Object
Returns the value of attribute build_environment.
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#locales ⇒ Object
Returns the value of attribute locales.
Instance Method Summary collapse
- #buildable? ⇒ Boolean
- #enabled? ⇒ Boolean
-
#initialize ⇒ Translate
constructor
A new instance of Translate.
Constructor Details
#initialize ⇒ Translate
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_environment ⇒ Object
Returns the value of attribute build_environment.
10 11 12 |
# File 'lib/voltron/config/translate.rb', line 10 def build_environment @build_environment end |
#enabled ⇒ Object
Returns the value of attribute enabled.
10 11 12 |
# File 'lib/voltron/config/translate.rb', line 10 def enabled @enabled end |
#locales ⇒ Object
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
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
18 19 20 |
# File 'lib/voltron/config/translate.rb', line 18 def enabled? enabled == true end |