Module: GOBL::Extensions::I18n::ValueKeysHelper
- Included in:
- I18n::String
- Defined in:
- lib/gobl/extensions/i18n/value_keys_helper.rb
Overview
Additional methods for the generated I18n::String class
Instance Method Summary collapse
-
#method_missing(method_name, *args, &block) ⇒ Object
Enables dynamic getter methods for the mapped keys.
- #respond_to_missing?(method_name) ⇒ Boolean private
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, &block) ⇒ Object
Enables dynamic getter methods for the mapped keys.
14 15 16 17 18 19 20 |
# File 'lib/gobl/extensions/i18n/value_keys_helper.rb', line 14 def method_missing(method_name, *args, &block) if _map.key?(method_name) || _map.key?(method_name.to_s) _map[method_name] || _map[method_name.to_s] else super end end |
Instance Method Details
#respond_to_missing?(method_name) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
23 24 25 |
# File 'lib/gobl/extensions/i18n/value_keys_helper.rb', line 23 def respond_to_missing?(method_name, *) _map.key?(method_name) || _map.key?(method_name.to_s) || super end |