123456789_123456789_123456789_123456789_123456789_

Class: ActionView::I18nProxy

Do not use. This class is for internal use only.
Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, I18n::Config
Instance Chain:
self, I18n::Config
Inherits: I18n::Config
  • ::Object
Defined in: actionview/lib/action_view/rendering.rb

Overview

This is a class to fix ::I18n global state. Whenever you provide I18n.locale during a request, it will trigger the lookup_context and consequently expire the cache.

Class Method Summary

Instance Attribute Summary

Constructor Details

.new(original_config, lookup_context) ⇒ I18nProxy

[ GitHub ]

  
# File 'actionview/lib/action_view/rendering.rb', line 11

def initialize(original_config, lookup_context)
  original_config = original_config.original_config if original_config.respond_to?(:original_config)
  @original_config = original_config
  @lookup_context = lookup_context
end

Instance Attribute Details

#locale (rw)

[ GitHub ]

  
# File 'actionview/lib/action_view/rendering.rb', line 17

def locale
  @original_config.locale
end

#locale=(value) (rw)

[ GitHub ]

  
# File 'actionview/lib/action_view/rendering.rb', line 21

def locale=(value)
  @lookup_context.locale = value
end

#lookup_context (readonly)

[ GitHub ]

  
# File 'actionview/lib/action_view/rendering.rb', line 9

attr_reader :original_config, :lookup_context

#original_config (readonly)

[ GitHub ]

  
# File 'actionview/lib/action_view/rendering.rb', line 9

attr_reader :original_config, :lookup_context