Class: Wingtips::Configuration

Inherits:
Object
  • Object
show all
Includes:
DSL
Defined in:
lib/wingtips/configuration.rb

Class Attribute Summary collapse

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from DSL

#slide

Constructor Details

#initialize(path) ⇒ Configuration

Returns a new instance of Configuration.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/wingtips/configuration.rb', line 7

def initialize(path)
  self.class.current = self
  @app_options = {
    title:      'Presentation',
    fullscreen: true
  }

  full_path = File.expand_path(path)
  load_templates full_path
  load_named_slides full_path

  # the empty slide at the start is needed as otherwise the dimensions
  # of the first slide are most likely messed up
  @slide_classes = [Wingtips::Slide]

  self.instance_eval(File.read(full_path))
end

Class Attribute Details

.currentObject

Returns the value of attribute current.



38
39
40
# File 'lib/wingtips/configuration.rb', line 38

def current
  @current
end

Instance Attribute Details

#app_optionsObject (readonly)

Returns the value of attribute app_options.



5
6
7
# File 'lib/wingtips/configuration.rb', line 5

def app_options
  @app_options
end

#slide_classesObject (readonly)

Returns the value of attribute slide_classes.



5
6
7
# File 'lib/wingtips/configuration.rb', line 5

def slide_classes
  @slide_classes
end

Instance Method Details

#slides(*slide_classes) ⇒ Object



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

def slides(*slide_classes)
  @slide_classes.concat(slide_classes)
end

#startup_options(opts = {}) ⇒ Object



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

def startup_options(opts={})
  @app_options.merge!(opts)
end

#unnamed_slides_allowed?Boolean

Returns:

  • (Boolean)


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

def unnamed_slides_allowed?
  @allow_unnamed_slides
end