Class: TableSaw::DependencyGraph::AddDirective
- Inherits:
-
Object
- Object
- TableSaw::DependencyGraph::AddDirective
- Defined in:
- lib/table_saw/dependency_graph/add_directive.rb
Instance Attribute Summary collapse
-
#ids ⇒ Object
Returns the value of attribute ids.
-
#partial ⇒ Object
(also: #partial?)
readonly
Returns the value of attribute partial.
-
#table_name ⇒ Object
readonly
Returns the value of attribute table_name.
Instance Method Summary collapse
-
#initialize(table_name, ids: [], partial: true) ⇒ AddDirective
constructor
A new instance of AddDirective.
- #queryable? ⇒ Boolean
- #selectable? ⇒ Boolean
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
#ids ⇒ Object
Returns the value of attribute ids.
7 8 9 |
# File 'lib/table_saw/dependency_graph/add_directive.rb', line 7 def ids @ids end |
#partial ⇒ Object (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_name ⇒ Object (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
21 22 23 |
# File 'lib/table_saw/dependency_graph/add_directive.rb', line 21 def queryable? !partial || selectable? end |
#selectable? ⇒ Boolean
17 18 19 |
# File 'lib/table_saw/dependency_graph/add_directive.rb', line 17 def selectable? partial? && Array(ids).size.positive? end |