class HecksAdapters::SQLDatabase::Commands::Delete

Delete a resource

Public Class Methods

new(id:, head:) click to toggle source
# File lib/commands/delete.rb, line 6
def initialize(id:, head:)
  @id = id
  @head = head
end

Public Instance Methods

call() click to toggle source
# File lib/commands/delete.rb, line 11
def call
  table = Table.factory([@head]).first
  DB[table.name.to_sym].where(id: @id).delete
  self
end