Module: Scenarios

Defined in:
lib/scenarios.rb,
lib/scenarios/base.rb,
lib/scenarios/scenario.rb

Defined Under Namespace

Classes: Base, Scenario

Class Method Summary collapse

Class Method Details

.[](k) ⇒ Hash

Returns a particular scenario group.

Parameters:

  • k (String, Symbol)

    the name of the scenario group to get

Returns:

  • (Hash)

    a particular scenario group



23
24
25
# File 'lib/scenarios.rb', line 23

def self.[](k)
  self.store[k.to_sym]
end

.clearObject

Remove all scenario groups



30
31
32
# File 'lib/scenarios.rb', line 30

def self.clear
  @store = {}
end

.register(obj) ⇒ Object

Register a Scenario instance with the module.

Parameters:



8
9
10
# File 'lib/scenarios.rb', line 8

def self.register(obj)
  store[obj.name.to_sym] = obj
end

.storeHash

Returns the hash of scenario groups.

Returns:

  • (Hash)

    the hash of scenario groups



15
16
17
# File 'lib/scenarios.rb', line 15

def self.store
  @store ||= {}
end