Method: XQuery::Abstract.alias_on_q
- Defined in:
- lib/xquery/abstract.rb
.alias_on_q(name, return_self = false) ⇒ Object
Aliases method to __method and q.method
42 43 44 45 46 47 48 49 50 |
# File 'lib/xquery/abstract.rb', line 42 def self.alias_on_q(name, return_self = false) alias_method("__#{name}", name) private("__#{name}") query_proxy.send(:define_method, name) do |*args, &block| result = instance.send("__#{name}", *args, &block) return_self ? self : result end end |