Sha256: 19d46859b2aa0668ffda97d43a59efedf660e7663be7f63f803aaff96cb9f910

Contents?: true

Size: 416 Bytes

Versions: 7

Compression:

Stored size: 416 Bytes

Contents

# frozen_string_literal: true

require 'micro/service'

module Micro
  class Service::WithValidation < Micro::Service::Base
    include Micro::Attributes::Features::ActiveModelValidations

    def call
      return Failure(errors: self.errors) unless valid?

      super
    end
  end

  class Service::Strict::Validation < Service::WithValidation
    include Micro::Attributes::Features::StrictInitialize
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
u-service-0.12.0 lib/micro/service/with_validation.rb
u-service-0.11.0 lib/micro/service/with_validation.rb
u-service-0.10.0 lib/micro/service/with_validation.rb
u-service-0.9.0 lib/micro/service/with_validation.rb
u-service-0.8.0 lib/micro/service/with_validation.rb
u-service-0.7.0 lib/micro/service/with_validation.rb
u-service-0.6.0 lib/micro/service/with_validation.rb