Class: Backstage

Inherits:
Object show all
Defined in:
lib/gamebox/core/backstage.rb

Overview

Backstage is a place to store things across stages. It does not allow you to store Actors here.

Instance Method Summary collapse

Constructor Details

#initializeBackstage

Returns a new instance of Backstage.



3
4
5
# File 'lib/gamebox/core/backstage.rb', line 3

def initialize
  @storage = {}
end

Instance Method Details

#get(key) ⇒ Object Also known as: []



13
14
15
# File 'lib/gamebox/core/backstage.rb', line 13

def get(key)
  @storage[key]
end

#set(key, value) ⇒ Object Also known as: []=



7
8
9
10
# File 'lib/gamebox/core/backstage.rb', line 7

def set(key, value)
  raise "Actors cannot wander back stage!" if value.is_a? Actor
  @storage[key] = value
end