Module: StoryTeller::Library::Bootstrap

Defined in:
lib/story_teller/library/bootstrap.rb

Overview

The StoryTeller::Library::Bootstrap module

Class Method Summary collapse

Class Method Details

.manage_inform_library(player: nil) ⇒ Object



30
31
32
33
34
35
# File 'lib/story_teller/library/bootstrap.rb', line 30

def manage_inform_library(player: nil)
  existing = StoryTeller::Engine.libraries[player] unless player.nil?
  return existing unless existing.nil?

  new_inform_library(player:)
end

.new_inform_library(player: nil) ⇒ Object



37
38
39
40
41
42
43
# File 'lib/story_teller/library/bootstrap.rb', line 37

def new_inform_library(player: nil)
  inflib = InformLibrary.new
  bind_inform_library(inflib, player)
  inflib.subscribe(inflib.selfobj)
  ensure_location(inflib)
  inflib
end