Module: Kiosk::Localizable::Resource::ClassMethods
- Defined in:
- lib/kiosk/localizable/resource.rb
Instance Attribute Summary collapse
-
#locale_scope_stack ⇒ Object
Returns the value of attribute locale_scope_stack.
Instance Method Summary collapse
-
#localized_to(locale, &blk) ⇒ Object
Executes the given block within a scope that translates found content resources to the given locale.
-
#with_locale(locale, &blk) ⇒ Object
Executes the given block within a scope that limits found content resources to the given locale.
Instance Attribute Details
#locale_scope_stack ⇒ Object
Returns the value of attribute locale_scope_stack.
12 13 14 |
# File 'lib/kiosk/localizable/resource.rb', line 12 def locale_scope_stack @locale_scope_stack end |
Instance Method Details
#localized_to(locale, &blk) ⇒ Object
Executes the given block within a scope that translates found content resources to the given locale. See Resource.with_params
for details on scope execution and inheritance.
25 26 27 |
# File 'lib/kiosk/localizable/resource.rb', line 25 def localized_to(locale, &blk) with_parameters(:to_language => locale, &blk) end |
#with_locale(locale, &blk) ⇒ Object
Executes the given block within a scope that limits found content resources to the given locale.
17 18 19 |
# File 'lib/kiosk/localizable/resource.rb', line 17 def with_locale(locale, &blk) with_parameters(:language => locale, &blk) end |