Sha256: e6caaf45c7c8d8f22fcf22682253d530f38682c35200e5219beba89766cdc1a8

Contents?: true

Size: 593 Bytes

Versions: 4

Compression:

Stored size: 593 Bytes

Contents

require 'aldous/service/wrapper'
require 'aldous/errors/user_error'

module Aldous
  class Service
    include Aldous

    class << self
      def build(*args)
        Aldous::Service::Wrapper.new(new(*args))
      end

      def perform(*args)
        build(*args).perform
      end

      def perform!(*args)
        build(*args).perform!
      end
    end

    def perform
      raise NotImplementedError.new("#{self.class.name} must implement method #perform")
    end

    def raisable_error
      Aldous::Errors::UserError
    end

    def default_result_data
      {}
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
aldous-1.1.3 lib/aldous/service.rb
aldous-1.1.2 lib/aldous/service.rb
aldous-1.0.1 lib/aldous/service.rb
aldous-1.0.0 lib/aldous/service.rb