Class: Hecks::Adapters::SQLDatabase::Commands::Update::DeleteReferences
- Inherits:
-
Object
- Object
- Hecks::Adapters::SQLDatabase::Commands::Update::DeleteReferences
- Defined in:
- lib/commands/update/delete_references.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(table:, attributes:, reference:) ⇒ DeleteReferences
constructor
A new instance of DeleteReferences.
Constructor Details
#initialize(table:, attributes:, reference:) ⇒ DeleteReferences
Returns a new instance of DeleteReferences.
9 10 11 12 13 14 15 |
# File 'lib/commands/update/delete_references.rb', line 9 def initialize(table:, attributes:, reference:) @table = table @attributes = attributes @reference = reference @where_clause = {} @dataset = DB[JoinTable.new(@table, @reference).name.to_sym] end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
7 8 9 |
# File 'lib/commands/update/delete_references.rb', line 7 def attributes @attributes end |
Instance Method Details
#call ⇒ Object
17 18 19 20 21 22 |
# File 'lib/commands/update/delete_references.rb', line 17 def call # build_where_clause delete_references remove_references_from_attributes self end |