Module: ExampleActorClass

### Home Classes Methods

### In Files

- lib/celluloid/rspec/example_actor_class.rb

### Methods

- ::create
- ::new
- #actor?
- #call_private
- #change_name
- #change_name_async
- #crash
- #crash_with_abort
- #crash_with_abort_raw
- #delegates?
- #external_hello
- #greet
- #inspect_thunk
- #internal_hello
- #method_missing
- #my_finalizer
- #respond_to?
- #run
- #run_on_receiver
- #send
- #shutdown
- #sleepy
- #zomg_private

### Class/Module Index

Quicksearch

- Celluloid
- Celluloid::AbortError
- Celluloid::AbstractProxy
- Celluloid::Actor
- Celluloid::Actor::Sleeper
- Celluloid::ActorProxy
- Celluloid::ActorSystem
- Celluloid::AsyncCall
- Celluloid::AsyncProxy
- Celluloid::BlockCall
- Celluloid::BlockProxy
- Celluloid::BlockResponse
- Celluloid::CPUCounter
- Celluloid::Call
- Celluloid::CallChain
- Celluloid::Cell
- Celluloid::Cell::ExitHandler
- Celluloid::CellProxy
- Celluloid::ClassMethods
- Celluloid::Condition
- Celluloid::Condition::Waiter
- Celluloid::ConditionError
- Celluloid::DeadTaskError
- Celluloid::ErrorResponse
- Celluloid::EventedMailbox
- Celluloid::ExitEvent
- Celluloid::FSM
- Celluloid::FSM::ClassMethods
- Celluloid::FSM::State
- Celluloid::FSM::UnattachedError
- Celluloid::FiberStackError
- Celluloid::Future
- Celluloid::Future::Result
- Celluloid::FutureProxy
- Celluloid::Handler
- Celluloid::Handlers
- Celluloid::Incident
- Celluloid::IncidentLogger
- Celluloid::IncidentLogger::Severity
- Celluloid::IncidentReporter
- Celluloid::IncidentReporter::Formatter
- Celluloid::InstanceMethods
- Celluloid::InternalPool
- Celluloid::LinkingRequest
- Celluloid::LinkingResponse
- Celluloid::Links
- Celluloid::LogEvent
- Celluloid::Logger
- Celluloid::Logger::WithBacktrace
- Celluloid::Mailbox
- Celluloid::MailboxDead
- Celluloid::MailboxShutdown
- Celluloid::Method
- Celluloid::NamingRequest
- Celluloid::NotTaskError
- Celluloid::Notifications
- Celluloid::Notifications::Fanout
- Celluloid::Notifications::Subscriber
- Celluloid::PoolManager
- Celluloid::Probe
- Celluloid::Properties
- Celluloid::Receiver
- Celluloid::Receivers
- Celluloid::Registry
- Celluloid::Response
- Celluloid::ResumableError
- Celluloid::RingBuffer
- Celluloid::SignalConditionRequest
- Celluloid::Signals
- Celluloid::StackDump
- Celluloid::StackDump::ActorState
- Celluloid::StackDump::CellState
- Celluloid::StackDump::DisplayBacktrace
- Celluloid::StackDump::TaskState
- Celluloid::StackDump::ThreadState
- Celluloid::SuccessResponse
- Celluloid::SupervisionGroup
- Celluloid::SupervisionGroup::Member
- Celluloid::Supervisor
- Celluloid::SyncCall
- Celluloid::SyncProxy
- Celluloid::SystemEvent
- Celluloid::Task
- Celluloid::Task::TerminatedError
- Celluloid::Task::TimeoutError
- Celluloid::TaskFiber
- Celluloid::TaskSet
- Celluloid::TaskThread
- Celluloid::TerminationRequest
- Celluloid::Thread
- Celluloid::ThreadHandle
- Celluloid::UUID
- org
- org::jruby
- org::jruby::ext
- org::jruby::ext::fiber
- org::jruby::ext::fiber::ThreadFiber
- Bar
- Baz
- Blocker
- ExampleActorClass
- ExampleCrash
- ExampleMailbox
- ExampleProxy
- ExampleTask
- Fiber
- Foo
- MockActor
- Object
- Thread

No matching classes.

# ExampleActorClass

### Public Class Methods

create(included_module, task_klass) click to toggle source

    # File lib/celluloid/rspec/example_actor_class.rb, line 2
    def self.create(included_module, task_klass)
      Class.new do
        include included_module
        task_class task_klass
        attr_reader :name
        finalizer :my_finalizer
        execute_block_on_receiver :run_on_receiver

        def initialize(name)
          @name = name
          @delegate = [:bar]
        end

        def sleepy(duration)
          sleep duration
        end

        def change_name(new_name)
          @name = new_name
        end

        def change_name_async(new_name)
          async.change_name new_name
        end

        def greet
          "Hi, I'm #{@name}"
        end

        def actor?
          Celluloid.actor?
        end

        def run(*args)
          yield(*args)
        end

        def run_on_receiver(*args)
          yield(*args)
        end

        def crash
          raise ExampleCrash, "the spec purposely crashed me :("
        end

        def crash_with_abort(reason, foo = nil)
          example_crash = ExampleCrash.new(reason)
          example_crash.foo = foo
          abort example_crash
        end

        def crash_with_abort_raw(reason)
          abort reason
        end

        def internal_hello
          external_hello
        end

        def external_hello
          "Hello"
        end

        def inspect_thunk
          inspect
        end

        def send(string)
          string.reverse
        end

        def shutdown
          terminate
        end

        def method_missing(method_name, *args, &block)
          if delegates?(method_name)
            @delegate.send method_name, *args, &block
          else
            super
          end
        end

        def respond_to?(method_name, include_private = false)
          super || delegates?(method_name)
        end

        def call_private
          async.zomg_private
        end

        def zomg_private
          @private_called = true
        end
        private :zomg_private
        attr_reader :private_called

        def my_finalizer
        end

        private

        def delegates?(method_name)
          @delegate.respond_to?(method_name)
        end
      end
    end

new(name) click to toggle source

    # File lib/celluloid/rspec/example_actor_class.rb, line 10
    def initialize(name)
      @name = name
      @delegate = [:bar]
    end

### Public Instance Methods

actor?() click to toggle source

    # File lib/celluloid/rspec/example_actor_class.rb, line 31
    def actor?
      Celluloid.actor?
    end

call_private() click to toggle source

    # File lib/celluloid/rspec/example_actor_class.rb, line 89
    def call_private
      async.zomg_private
    end

change_name(new_name) click to toggle source

    # File lib/celluloid/rspec/example_actor_class.rb, line 19
    def change_name(new_name)
      @name = new_name
    end

change_name_async(new_name) click to toggle source

    # File lib/celluloid/rspec/example_actor_class.rb, line 23
    def change_name_async(new_name)
      async.change_name new_name
    end

crash() click to toggle source

    # File lib/celluloid/rspec/example_actor_class.rb, line 43
    def crash
      raise ExampleCrash, "the spec purposely crashed me :("
    end

crash_with_abort(reason, foo = nil) click to toggle source

    # File lib/celluloid/rspec/example_actor_class.rb, line 47
    def crash_with_abort(reason, foo = nil)
      example_crash = ExampleCrash.new(reason)
      example_crash.foo = foo
      abort example_crash
    end

crash_with_abort_raw(reason) click to toggle source

    # File lib/celluloid/rspec/example_actor_class.rb, line 53
    def crash_with_abort_raw(reason)
      abort reason
    end

delegates?(method_name) click to toggle source

    # File lib/celluloid/rspec/example_actor_class.rb, line 104
    def delegates?(method_name)
      @delegate.respond_to?(method_name)
    end

external_hello() click to toggle source

    # File lib/celluloid/rspec/example_actor_class.rb, line 61
    def external_hello
      "Hello"
    end

greet() click to toggle source

    # File lib/celluloid/rspec/example_actor_class.rb, line 27
    def greet
      "Hi, I'm #{@name}"
    end

inspect_thunk() click to toggle source

    # File lib/celluloid/rspec/example_actor_class.rb, line 65
    def inspect_thunk
      inspect
    end

internal_hello() click to toggle source

    # File lib/celluloid/rspec/example_actor_class.rb, line 57
    def internal_hello
      external_hello
    end

method_missing(method_name, *args, &block) click to toggle source

    # File lib/celluloid/rspec/example_actor_class.rb, line 77
    def method_missing(method_name, *args, &block)
      if delegates?(method_name)
        @delegate.send method_name, *args, &block
      else
        super
      end
    end

my_finalizer() click to toggle source

    # File lib/celluloid/rspec/example_actor_class.rb, line 99
    def my_finalizer
    end

respond_to?(method_name, include_private = false) click to toggle source

    # File lib/celluloid/rspec/example_actor_class.rb, line 85
    def respond_to?(method_name, include_private = false)
      super || delegates?(method_name)
    end

run(*args) click to toggle source

    # File lib/celluloid/rspec/example_actor_class.rb, line 35
    def run(*args)
      yield(*args)
    end

run_on_receiver(*args) click to toggle source

    # File lib/celluloid/rspec/example_actor_class.rb, line 39
    def run_on_receiver(*args)
      yield(*args)
    end

send(string) click to toggle source

    # File lib/celluloid/rspec/example_actor_class.rb, line 69
    def send(string)
      string.reverse
    end

shutdown() click to toggle source

    # File lib/celluloid/rspec/example_actor_class.rb, line 73
    def shutdown
      terminate
    end

sleepy(duration) click to toggle source

    # File lib/celluloid/rspec/example_actor_class.rb, line 15
    def sleepy(duration)
      sleep duration
    end

zomg_private() click to toggle source

    # File lib/celluloid/rspec/example_actor_class.rb, line 93
    def zomg_private
      @private_called = true
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.