Class: PseudoL10n::Backend
- Inherits:
-
Object
- Object
- PseudoL10n::Backend
show all
- Defined in:
- lib/pseudo_l10n/backend.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(original_backend) ⇒ Backend
Returns a new instance of Backend.
5
6
7
|
# File 'lib/pseudo_l10n/backend.rb', line 5
def initialize(original_backend)
@original_backend = original_backend
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
9
10
11
12
13
14
15
|
# File 'lib/pseudo_l10n/backend.rb', line 9
def method_missing(name, *args, &block)
if respond_to_missing?(name)
original_backend.public_send(name, *args, &block)
else
super
end
end
|
Instance Attribute Details
#original_backend ⇒ Object
Returns the value of attribute original_backend.
3
4
5
|
# File 'lib/pseudo_l10n/backend.rb', line 3
def original_backend
@original_backend
end
|
Instance Method Details
#available_locales ⇒ Object
40
41
42
43
|
# File 'lib/pseudo_l10n/backend.rb', line 40
def available_locales
available = original_backend.available_locales
available << PseudoL10n.pseudo_locale
end
|
#respond_to_missing?(name, include_private = false) ⇒ Boolean
17
18
19
|
# File 'lib/pseudo_l10n/backend.rb', line 17
def respond_to_missing?(name, include_private = false)
original_backend.respond_to?(name) || super
end
|
#translate(locale, key, options) ⇒ Object