Sha256: 78114d323e612604021ef9d055e978e4af56081ee763b0aa73f34134c33f8dd2

Contents?: true

Size: 615 Bytes

Versions: 2

Compression:

Stored size: 615 Bytes

Contents

module Commons
  module Services
    module Concerns
      module Callable
        extend ActiveSupport::Concern

        class_methods do
          def call(*args, **kwargs)
            # This approach allows thge class initializer to use regular arguments,
            # named argumets or the mix of both.
            # This at the same time allows the usage of Dry::Initializer
            # https://dry-rb.org/gems/dry-initializer/3.0/
            # And perhaps this can eventually be a defualt part of Callable Module
            new(*args, **kwargs).call
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
commons_yellowme-0.16.0 lib/commons/services/concerns/callable.rb
commons_yellowme-0.15.0 lib/commons/services/concerns/callable.rb