Class: Hecks::Domain::Adapters::SQLDatabase::Commands::Update::DeleteReferences
- Inherits:
-
Object
- Object
- Hecks::Domain::Adapters::SQLDatabase::Commands::Update::DeleteReferences
- Defined in:
- lib/adapters/sql_database/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.
10 11 12 13 14 15 16 |
# File 'lib/adapters/sql_database/commands/update/delete_references.rb', line 10 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.
8 9 10 |
# File 'lib/adapters/sql_database/commands/update/delete_references.rb', line 8 def attributes @attributes end |
Instance Method Details
#call ⇒ Object
18 19 20 21 22 23 |
# File 'lib/adapters/sql_database/commands/update/delete_references.rb', line 18 def call build_where_clause delete_references remove_references_from_attributes self end |