Class: Rabbit::Theme::Manager

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/rabbit/theme/manager.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(canvas, &callback) ⇒ Manager

Returns a new instance of Manager.



13
14
15
16
17
# File 'lib/rabbit/theme/manager.rb', line 13

def initialize(canvas, &callback)
  @canvas = canvas
  @applier = Applier.new(self, &callback)
  apply("base")
end

Instance Attribute Details

#canvasObject (readonly)

Returns the value of attribute canvas.



12
13
14
# File 'lib/rabbit/theme/manager.rb', line 12

def canvas
  @canvas
end

#nameObject (readonly)

Returns the value of attribute name.



12
13
14
# File 'lib/rabbit/theme/manager.rb', line 12

def name
  @name
end

Instance Method Details

#apply(name) ⇒ Object



19
20
21
22
23
24
25
26
27
28
# File 'lib/rabbit/theme/manager.rb', line 19

def apply(name)
  @name = name
  begin
    @applier.apply_theme(name)
  rescue ThemeExit
    logger.info($!.message) if $!.have_message?
  rescue StandardError, LoadError, SyntaxError
    logger.warn($!)
  end
end

#slidesObject



30
31
32
# File 'lib/rabbit/theme/manager.rb', line 30

def slides
  @canvas.slides
end