Sha256: 58e1670ffc6709e0f884997d158811bb8ffd6d6799fae90c4edfab32fc6ec89b

Contents?: true

Size: 662 Bytes

Versions: 9

Compression:

Stored size: 662 Bytes

Contents

module Celluloid
  # Method handles that route through an actor proxy
  class Method

    def initialize(proxy, name)
      raise NameError, "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::Method #{@klass}##{@name}>"
    end
  end
end

Version data entries

9 entries across 7 versions & 4 rubygems

Version Path
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/celluloid-0.16.0/lib/celluloid/method.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/celluloid-0.16.0/lib/celluloid/method.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/celluloid-0.16.0/lib/celluloid/method.rb
scoot-0.0.4 .bundle/gems/ruby/2.2.0/gems/celluloid-0.16.0/lib/celluloid/method.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/celluloid-0.16.0/lib/celluloid/method.rb
celluloid-0.16.0 lib/celluloid/method.rb
celluloid-0.16.0.pre3 lib/celluloid/method.rb
celluloid-0.16.0.pre2 lib/celluloid/method.rb
celluloid-0.16.0.pre lib/celluloid/method.rb