Class: Screenplay::Actor

Inherits:
Object
  • Object
show all
Defined in:
lib/screenplay/actor.rb

Direct Known Subclasses

ApiActor, CacheActor, DataActor, PromptActor, TestActor

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Actor

Returns a new instance of Actor.



27
28
29
30
# File 'lib/screenplay/actor.rb', line 27

def initialize(name)
	@name = name.to_sym
	configure(Configuration[@name] || {})
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



25
26
27
# File 'lib/screenplay/actor.rb', line 25

def name
  @name
end

Class Method Details

.descendantsObject



32
33
34
# File 'lib/screenplay/actor.rb', line 32

def self.descendants
	ObjectSpace.each_object(Class).select { | klass | klass < self }
end

Instance Method Details

#configure(config = {}) ⇒ Object



36
37
38
# File 'lib/screenplay/actor.rb', line 36

def configure(config = {})
	# Not needed to override this, but might be useful
end

#play(params, input) ⇒ Object



40
41
42
# File 'lib/screenplay/actor.rb', line 40

def play(params, input)
	raise MethodNotImplemented.new('play')
end