Class: TableSaw::DependencyGraph::AddDirective

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(table_name, ids: [], partial: true) ⇒ AddDirective

Returns a new instance of AddDirective.



9
10
11
12
13
# File 'lib/table_saw/dependency_graph/add_directive.rb', line 9

def initialize(table_name, ids: [], partial: true)
  @table_name = table_name
  @ids = ids
  @partial = partial
end

Instance Attribute Details

#idsObject

Returns the value of attribute ids.



7
8
9
# File 'lib/table_saw/dependency_graph/add_directive.rb', line 7

def ids
  @ids
end

#partialObject (readonly) Also known as: partial?

Returns the value of attribute partial.



6
7
8
# File 'lib/table_saw/dependency_graph/add_directive.rb', line 6

def partial
  @partial
end

#table_nameObject (readonly)

Returns the value of attribute table_name.



6
7
8
# File 'lib/table_saw/dependency_graph/add_directive.rb', line 6

def table_name
  @table_name
end

Instance Method Details

#queryable?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/table_saw/dependency_graph/add_directive.rb', line 21

def queryable?
  !partial || selectable?
end

#selectable?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/table_saw/dependency_graph/add_directive.rb', line 17

def selectable?
  partial? && Array(ids).size.positive?
end