Class: TableSaw::DependencyGraph::BelongsToDirectives

Inherits:
Object
  • Object
show all
Defined in:
lib/table_saw/dependency_graph/belongs_to_directives.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#directiveObject (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

#callObject



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