Sha256: 32a346612ae3f2cb2a7a85007e00da798f23498299b7ddcf0f9a1f8f314c7b58

Contents?: true

Size: 359 Bytes

Versions: 18

Compression:

Stored size: 359 Bytes

Contents

class CC::Service::Invocation
  class WithReturnValues
    def initialize(invocation, message = nil)
      @invocation = invocation
      @message = message || "An internal error happened"
    end

    def call
      result = @invocation.call
      if result.nil?
        { ok: false, message: @message }
      else
        result
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
codeclimate-services-1.11.4 lib/cc/service/invocation/with_return_values.rb
codeclimate-services-1.11.3 lib/cc/service/invocation/with_return_values.rb
codeclimate-services-1.11.2 lib/cc/service/invocation/with_return_values.rb
codeclimate-services-1.11.1 lib/cc/service/invocation/with_return_values.rb
codeclimate-services-1.11.0 lib/cc/service/invocation/with_return_values.rb
codeclimate-services-1.10.1 lib/cc/service/invocation/with_return_values.rb
codeclimate-services-1.10.0 lib/cc/service/invocation/with_return_values.rb
codeclimate-services-1.9.8 lib/cc/service/invocation/with_return_values.rb
codeclimate-services-1.9.7 lib/cc/service/invocation/with_return_values.rb
codeclimate-services-1.9.6 lib/cc/service/invocation/with_return_values.rb
codeclimate-services-1.9.5 lib/cc/service/invocation/with_return_values.rb
codeclimate-services-1.9.4 lib/cc/service/invocation/with_return_values.rb
codeclimate-services-1.9.3 lib/cc/service/invocation/with_return_values.rb
codeclimate-services-1.9.2 lib/cc/service/invocation/with_return_values.rb
codeclimate-services-1.9.1 lib/cc/service/invocation/with_return_values.rb
codeclimate-services-1.9.0 lib/cc/service/invocation/with_return_values.rb
codeclimate-services-1.8.0 lib/cc/service/invocation/with_return_values.rb
codeclimate-services-1.7.0 lib/cc/service/invocation/with_return_values.rb