Class: BabySqueel::Nodes::Attribute
- Defined in:
- lib/baby_squeel/nodes/attribute.rb
Instance Method Summary collapse
- #_arel ⇒ Object
- #in(rel) ⇒ Object
-
#initialize(parent, name) ⇒ Attribute
constructor
A new instance of Attribute.
- #not_in(rel) ⇒ Object
Methods included from Operators::ArelAliasing
Methods included from Operators::Generic
Methods inherited from Proxy
const_missing, #inspect, #respond_to?
Constructor Details
#initialize(parent, name) ⇒ Attribute
Returns a new instance of Attribute.
6 7 8 9 10 |
# File 'lib/baby_squeel/nodes/attribute.rb', line 6 def initialize(parent, name) @parent = parent @name = name.to_s super(parent._table[@name]) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class BabySqueel::Nodes::Proxy
Instance Method Details
#_arel ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/baby_squeel/nodes/attribute.rb', line 28 def _arel if @parent.kind_of?(BabySqueel::Association) && !@parent.alias? @parent.find_alias[@name] else super end end |