Sha256: 12ffe0982bf222e3bdfcd3f2b97ca3e87a5d163445a7b1f0043691db680bafae

Contents?: true

Size: 557 Bytes

Versions: 7

Compression:

Stored size: 557 Bytes

Contents

module SimpleService
  class EnsureOrganizerIsValid < Organizer

    expects :expected_keys, :provided_keys, :provided_commands

    # makes sure validtion is only done once, prevents an infinite loop
    skip_validation true

    commands ValidatesExpectedKeys,
             ValidatesCommandsNotEmpty,
             ValidatesCommandsProperlyInherit

    def call
      super

      # dont return the keys within this internal service
      # so we dont pollute external service objects
      context.select { |k,v| !expects.include?(k) }
    end

  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
simple_service-1.4.1 lib/simple_service/ensure_organizer_is_valid.rb
simple_service-1.4.0 lib/simple_service/ensure_organizer_is_valid.rb
simple_service-1.3.91 lib/simple_service/ensure_organizer_is_valid.rb
simple_service-1.3.9 lib/simple_service/ensure_organizer_is_valid.rb
simple_service-1.3.8 lib/simple_service/ensure_organizer_is_valid.rb
simple_service-1.3.5 lib/simple_service/ensure_organizer_is_valid.rb
simple_service-1.3.4 lib/simple_service/ensure_organizer_is_valid.rb