Class: TableSaw::DependencyGraph::BelongsToDirectives
- Inherits:
-
Object
- Object
- TableSaw::DependencyGraph::BelongsToDirectives
- Defined in:
- lib/table_saw/dependency_graph/belongs_to_directives.rb
Instance Attribute Summary collapse
-
#directive ⇒ Object
readonly
Returns the value of attribute directive.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(directive) ⇒ BelongsToDirectives
constructor
A new instance of BelongsToDirectives.
Constructor Details
#initialize(directive) ⇒ BelongsToDirectives
Returns a new instance of BelongsToDirectives.
8 9 10 |
# File 'lib/table_saw/dependency_graph/belongs_to_directives.rb', line 8 def initialize(directive) @directive = directive end |
Instance Attribute Details
#directive ⇒ Object (readonly)
Returns the value of attribute directive.
6 7 8 |
# File 'lib/table_saw/dependency_graph/belongs_to_directives.rb', line 6 def directive @directive end |
Instance Method Details
#call ⇒ Object
12 13 14 15 16 |
# File 'lib/table_saw/dependency_graph/belongs_to_directives.rb', line 12 def call associations.map do |from_column, to_table| TableSaw::DependencyGraph::AddDirective.new(to_table, ids: ids[from_column], partial: directive.partial?) end end |