Module: ShatteredController::Actor::InstanceMethods
- Defined in:
- lib/actor/actor.rb
Instance Method Summary collapse
-
#actor(name = nil, options = {}) ⇒ Object
Same as ShatteredController::Actor::ClassMethods#actor.
-
#actors ⇒ Object
This returns all of the actors created by this controller.
Instance Method Details
#actor(name = nil, options = {}) ⇒ Object
Same as ShatteredController::Actor::ClassMethods#actor
Returns a newly created actor
55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/actor/actor.rb', line 55 def actor(name=nil, ={}) raise Error, "actor needs a name" if name.nil? actor = Actor.new(name,load_actor_classes(name)) attr_reader(name.to_sym, actor) call_object_function_for_each_key( name.to_sym, ) @actors ||= [] @actors << actor return actor end |
#actors ⇒ Object
This returns all of the actors created by this controller.
48 49 50 |
# File 'lib/actor/actor.rb', line 48 def actors return @actors || [] end |