Sha256: 9f1192a2719a410fa7719b8f4f9dc4a582f392ca7d7d3a02cb6b37e45557d680

Contents?: true

Size: 360 Bytes

Versions: 20

Compression:

Stored size: 360 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

20 entries across 20 versions & 1 rubygems

Version Path
codeclimate-services-1.6.1 lib/cc/service/invocation/with_return_values.rb
codeclimate-services-1.6.0 lib/cc/service/invocation/with_return_values.rb
codeclimate-services-1.5.1 lib/cc/service/invocation/with_return_values.rb
codeclimate-services-1.5.0 lib/cc/service/invocation/with_return_values.rb
codeclimate-services-1.4.0 lib/cc/service/invocation/with_return_values.rb
codeclimate-services-1.3.0 lib/cc/service/invocation/with_return_values.rb
codeclimate-services-1.2.0 lib/cc/service/invocation/with_return_values.rb
codeclimate-services-1.1.0 lib/cc/service/invocation/with_return_values.rb
codeclimate-services-1.0.1 lib/cc/service/invocation/with_return_values.rb
codeclimate-services-1.0.0 lib/cc/service/invocation/with_return_values.rb
codeclimate-services-0.6.2 lib/cc/service/invocation/with_return_values.rb
codeclimate-services-0.6.1 lib/cc/service/invocation/with_return_values.rb
codeclimate-services-0.6.0 lib/cc/service/invocation/with_return_values.rb
codeclimate-services-0.5.3 lib/cc/service/invocation/with_return_values.rb
codeclimate-services-0.5.2 lib/cc/service/invocation/with_return_values.rb
codeclimate-services-0.5.1 lib/cc/service/invocation/with_return_values.rb
codeclimate-services-0.5.0 lib/cc/service/invocation/with_return_values.rb
codeclimate-services-0.4.1 lib/cc/service/invocation/with_return_values.rb
codeclimate-services-0.4.0 lib/cc/service/invocation/with_return_values.rb
codeclimate-services-0.3.0 lib/cc/service/invocation/with_return_values.rb