Sha256: 7e59a34891fbc74b681f2fa351ff88914e15475f9566c92e3233f9d0a6ddd696

Contents?: true

Size: 746 Bytes

Versions: 9

Compression:

Stored size: 746 Bytes

Contents

module Celluloid
  module Internals
    # Method handles that route through an actor proxy
    class Method
      def initialize(proxy, name)
        fail NoMethodError, "undefined method `#{name}'" unless proxy.respond_to? name

        @proxy, @name = proxy, name
        @klass = @proxy.class
      end

      def arity
        @proxy.method_missing(:method, @name).arity
      end

      def name
        @proxy.method_missing(:method, @name).name
      end

      def parameters
        @proxy.method_missing(:method, @name).parameters
      end

      def call(*args, &block)
        @proxy.__send__(@name, *args, &block)
      end

      def inspect
        "#<Celluloid::Internals::Method #{@klass}##{@name}>"
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
celluloid-essentials-0.20.5 lib/celluloid/internals/method.rb
celluloid-essentials-0.20.2.1 lib/celluloid/internals/method.rb
celluloid-essentials-0.20.2 lib/celluloid/internals/method.rb
celluloid-essentials-0.20.1.1 lib/celluloid/internals/method.rb
celluloid-essentials-0.20.1 lib/celluloid/internals/method.rb
celluloid-essentials-0.20.0 lib/celluloid/internals/method.rb
celluloid-essentials-0.20.0.pre17 lib/celluloid/internals/method.rb
celluloid-essentials-0.20.0.pre16 lib/celluloid/internals/method.rb
celluloid-essentials-0.20.0.pre15 lib/celluloid/internals/method.rb