Sha256: 8c98f06127e091c6b427bae437a452d703039d587d55a79a03d329e237bae2c1

Contents?: true

Size: 374 Bytes

Versions: 1

Compression:

Stored size: 374 Bytes

Contents

module Slayer
  class Command < Service
    singleton_skip_hook :call

    class << self
      def method_added(name)
        return unless name == :call
        super(name)
      end

      def call(*args, &block)
        self.new.call(*args, &block)
      end
    end

    def call
      raise NotImplementedError, 'Commands must define method `#call`.'
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
slayer-0.4.0.beta2 lib/slayer/command.rb