| 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:
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.
# File lib/dramatis/actor.rb, line 73
73: def self.new behavior = nil
74: ( Dramatis::Runtime::Actor.new behavior ).name
75: end
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.
# File lib/dramatis/actor.rb, line 51
51: def actor; end