Class: Acting

Inherits:
Object
  • Object
show all
Defined in:
lib/acting.rb,
lib/acting/version.rb

Defined Under Namespace

Modules: Cast Classes: Actor

Constant Summary collapse

VERSION =
"0.0.4"

Instance Method Summary collapse

Constructor Details

#initialize(cast) ⇒ Acting

Returns a new instance of Acting.



2
3
4
5
6
# File 'lib/acting.rb', line 2

def initialize(cast)
  @actors = cast.map do |actor, role|
    Actor.new(actor, role)
  end
end

Instance Method Details

#play(&block) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/acting.rb', line 8

def play(&block)
  if block_given?
    play_with_block(&block)
  else
    @actors.each(&:play)
  end
end

#quitObject



16
17
18
# File 'lib/acting.rb', line 16

def quit
  @actors.each(&:quit)
end