Class: TableSaw::DependencyGraph::HasManyDirectives
- Inherits:
-
Object
- Object
- TableSaw::DependencyGraph::HasManyDirectives
- Defined in:
- lib/table_saw/dependency_graph/has_many_directives.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#directive ⇒ Object
readonly
Returns the value of attribute directive.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(context, directive) ⇒ HasManyDirectives
constructor
A new instance of HasManyDirectives.
Constructor Details
#initialize(context, directive) ⇒ HasManyDirectives
Returns a new instance of HasManyDirectives.
8 9 10 11 |
# File 'lib/table_saw/dependency_graph/has_many_directives.rb', line 8 def initialize(context, directive) @context = context @directive = directive end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
6 7 8 |
# File 'lib/table_saw/dependency_graph/has_many_directives.rb', line 6 def context @context end |
#directive ⇒ Object (readonly)
Returns the value of attribute directive.
6 7 8 |
# File 'lib/table_saw/dependency_graph/has_many_directives.rb', line 6 def directive @directive end |
Instance Method Details
#call ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/table_saw/dependency_graph/has_many_directives.rb', line 13 def call valid_associations.map do |table, column| TableSaw::DependencyGraph::AddDirective.new( table, ids: query_result(table, column).map { |r| r['id'] }, partial: directive.partial? ) end end |