Module: MagicMirror

Defined in:
lib/magic_mirror.rb,
lib/magic_mirror/mirror.rb,
lib/magic_mirror/version.rb,
lib/magic_mirror/command_cache.rb

Defined Under Namespace

Classes: CommandCache, Mirror

Constant Summary collapse

FAYE_PORT =
4555
VERSION =
"0.1.1"
@@mirror =
nil
@@command_cache =

unless @@command_cache

CommandCache.new

Class Method Summary collapse

Class Method Details

.command_cacheObject



37
38
39
40
41
42
# File 'lib/magic_mirror.rb', line 37

def self.command_cache
  # [ "RenderingCanvas.new('myCanvas', { title: 'trtl', minsize: [800, 600], is_test: true })",
  #   "RenderingcLine.new('myCanvas', 0, 0, 50, 50)"
  # ]
  @@command_cache
end

.command_cache=(value) ⇒ Object



44
45
46
# File 'lib/magic_mirror.rb', line 44

def self.command_cache=(value)
  @@command_cache=value
end

.mirrorObject



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

def self.mirror
  @@mirror
end

.new(options = {}) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/magic_mirror.rb', line 17

def self.new(options = {})
  return @@mirror unless @@mirror.nil?
  @sinatra_root = options[:sinatra_root] ? options[:sinatra_root] : File.expand_path('../..', __FILE__)
  @@mirror = Mirror.new
  @@mirror.init_servers! if options[:init_servers]
  @@mirror
end

.sinatra_rootObject



33
34
35
# File 'lib/magic_mirror.rb', line 33

def self.sinatra_root
  @sinatra_root
end

.sinatra_root=(value) ⇒ Object



29
30
31
# File 'lib/magic_mirror.rb', line 29

def self.sinatra_root=(value)
  @sinatra_root = value
end