Method: Condom::Presentation#initialize

Defined in:
lib/condom/presentation.rb

#initialize(args = nil) ⇒ Presentation

The constructor. Argument could be:

  • nothing,

  • the title of the document,

  • a hash of options.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/condom/presentation.rb', line 13

def initialize(args = nil)
  # Need to initialize each variables else they won't exist in instance_variables.
  @listings = @graphics = @math = nil

  # The default options
  options = {
    :document_class => 'beamer',
    :title          => 'Presentation \LaTeX',
    :filename       => 'presentation',
    :listings       => false,
    :graphics       => true,
    :math           => false
  }

  if args.is_a? String
    options[:title] = args
  elsif args.is_a? Hash
    options.merge! args
  end

  super(options)
end