Module Dramatis::Actor
In: lib/dramatis/actor/name/interface.rb
lib/dramatis/actor/interface.rb
lib/dramatis/actor/name.rb
lib/dramatis/actor.rb

The Dramatis::Actor module is used to create actor classes and objects. An actor class can be created by mixing Dramatis::Actor, e.g.,

   class MyClass
     include Dramatis::Actor
     ...
   end

or can be used to create so called naked actors, e.g.,

   my_hash_actor = Dramatis::Actor.new Hash.new

When mixed in to a class, Dramatis::Actor has two effects:

  1. It causes new to return a Dramatis::Actor::Name rather than an object reference
  2. It defines an actor method which can be used by the class to access its actor name and otherwise affect its actor semantics

Methods

actor   new  

Included Modules

Dramatis

Classes and Modules

Class Dramatis::Actor::Interface
Class Dramatis::Actor::Name

Public Class methods

The first case is used when a class has mixed in Dramatis::Actor. In this case, the arguments are passed to the initialize of method of the including class like normal.

The second case is used when creating so called naked actors, e.g.,

 my_hash = Dramatis::Actor.new Hash.new

If no behavior is provided, the actor can be later bound to a behavior by calling Dramatis::Actor::Name::Interface.bind

In all cases, new returns a Dramatis::Actor::Name proxy object.

[Source]

    # File lib/dramatis/actor.rb, line 73
73:   def self.new behavior = nil
74:     ( Dramatis::Runtime::Actor.new behavior ).name
75:   end

Public Instance methods

actor provides classes that have mixed in Dramatis::Actor access to a Dramatis::Actor::Interface object by which they can access their actor name and other actor operations.

[Source]

    # File lib/dramatis/actor.rb, line 51
51:     def actor; end

[Validate]