class Tradesman::Builders::Delete

Private Class Methods

go(obj, *context, &block) click to toggle source
# File lib/tradesman/builders/delete.rb, line 12
def go(obj, *context, &block)
  run_and_convert_exceptions { run(tzu_params(obj, {}), *context, &block) }
end
go!(obj, *context) click to toggle source
# File lib/tradesman/builders/delete.rb, line 16
def go!(obj, *context)
  run_and_convert_exceptions { run!(tzu_params(obj, {}), *context) }
end

Private Instance Methods

execute_single(params) click to toggle source
# File lib/tradesman/builders/delete.rb, line 23
def execute_single(params)
  self.class.adapter.delete!(params[:id])
end
template_class(args) click to toggle source
# File lib/tradesman/builders/delete.rb, line 6
def template_class(args)
  Class.new(::Tradesman::Template) do
    include ::Tradesman::ExistingRecordsMultipleExecute
    @store = Tradesman.adapter.context_for_entity(args[:subject])

    class << self
      def go(obj, *context, &block)
        run_and_convert_exceptions { run(tzu_params(obj, {}), *context, &block) }
      end

      def go!(obj, *context)
        run_and_convert_exceptions { run!(tzu_params(obj, {}), *context) }
      end
    end

    private

    def execute_single(params)
      self.class.adapter.delete!(params[:id])
    end
  end
end