Sha256: 53359fe60a7c1d0b25889af11ace0722302b172ff8f5a92928a497fc518055ea
Contents?: true
Size: 564 Bytes
Versions: 9
Compression:
Stored size: 564 Bytes
Contents
# frozen_string_literal: true module Micro module Service class Base include Micro::Attributes.without(:strict_initialize) include Result::Helpers INVALID_RESULT = '#call! must return a Micro::Service::Result instance'.freeze def self.call(options = {}) new(options).call end def call! raise NotImplementedError end def call result = call! return result if result.is_a?(Service::Result) raise TypeError, self.class.name + INVALID_RESULT end end end end
Version data entries
9 entries across 9 versions & 1 rubygems