Class: ActiveRecordNestedScope::Builder
- Inherits:
-
Object
- Object
- ActiveRecordNestedScope::Builder
- Defined in:
- lib/activerecord_nested_scope/builder.rb
Instance Method Summary collapse
- #build(node = @node) ⇒ Object
-
#initialize(klass, name, args) ⇒ Builder
constructor
A new instance of Builder.
Constructor Details
#initialize(klass, name, args) ⇒ Builder
Returns a new instance of Builder.
5 6 7 8 9 |
# File 'lib/activerecord_nested_scope/builder.rb', line 5 def initialize(klass, name, args) @node = Node.new(klass, name) @args = args @args_type = args_type(args) end |
Instance Method Details
#build(node = @node) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/activerecord_nested_scope/builder.rb', line 11 def build(node = @node) if node.leaf? leaf_relation(node) else build_relation(node) end end |