class BabySqueel::Nodes::Proxy
This proxy class allows us to quack like any arel object. When a method missing is hit, we’ll instantiate a new proxy object.
Attributes
_arel[R]
Public Class Methods
const_missing(name)
click to toggle source
Resolve constants the normal way
# File lib/baby_squeel/nodes/proxy.rb, line 7 def self.const_missing(name) ::Object.const_get(name) end
new(arel)
click to toggle source
# File lib/baby_squeel/nodes/proxy.rb, line 13 def initialize(arel) @_arel = Nodes.unwrap(arel) end
Public Instance Methods
inspect()
click to toggle source
# File lib/baby_squeel/nodes/proxy.rb, line 17 def inspect "BabySqueel{#{super}}" end
respond_to?(meth, include_private = false)
click to toggle source
# File lib/baby_squeel/nodes/proxy.rb, line 21 def respond_to?(meth, include_private = false) meth.to_s == '_arel' || _arel.respond_to?(meth, include_private) end
Private Instance Methods
method_missing(meth, *args, &block)
click to toggle source
Calls superclass method
# File lib/baby_squeel/nodes/proxy.rb, line 27 def method_missing(meth, *args, &block) if _arel.respond_to?(meth) Nodes.wrap _arel.send(meth, *Nodes.unwrap(args), &block) else super end end