Module: Babylonia::VirtualAttributes
- Defined in:
- lib/babylonia/class_methods.rb
Overview
Method missing implementation for virtual attributes
Instance Method Summary collapse
-
#method_missing(meth, *args, &block) ⇒ Object
Define method missing to be able to access a language directly Enables to call a language virtual attribute directly.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *args, &block) ⇒ Object
Note:
Since the virtual attribute is called directly, there is no fallback on this unless you set it to true
Define method missing to be able to access a language directly Enables to call a language virtual attribute directly
103 104 105 106 107 108 109 |
# File 'lib/babylonia/class_methods.rb', line 103 def method_missing meth, *args, &block if parts = extract_locale_method_parts(meth) parts[2] ? send(parts[0] + parts[2].to_s, { parts[1].to_sym => args.first }) : send(parts[0], parts[1].to_sym, args.first || {}) else super(meth, *args, &block) end end |