Module: ShatteredController::Actor::InstanceMethods

Defined in:
lib/actor/actor.rb

Instance Method Summary collapse

Instance Method Details

#actor(name = nil, options = {}) ⇒ Object

Same as ShatteredController::Actor::ClassMethods#actor

Returns a newly created actor

Raises:



55
56
57
58
59
60
61
62
63
64
65
# File 'lib/actor/actor.rb', line 55

def actor(name=nil, options={})
  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, options )

  @actors ||= []
  @actors << actor
  return actor
end

#actorsObject

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