Class: Marksman::Presentation

Inherits:
Object
  • Object
show all
Includes:
Equality
Defined in:
lib/marksman/presentation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Equality

#==, #attributes

Constructor Details

#initialize(options) ⇒ Presentation

Returns a new instance of Presentation.



6
7
8
9
10
11
# File 'lib/marksman/presentation.rb', line 6

def initialize(options)
  @filename = options[:filename]
  @slides   = options[:slides] || []
  @metadata = defaults(filename).merge(options[:metadata] || {})
  @theme    = Theme.new @metadata[:theme]
end

Instance Attribute Details

#filenameObject

Returns the value of attribute filename.



4
5
6
# File 'lib/marksman/presentation.rb', line 4

def filename
  @filename
end

#metadataObject

Returns the value of attribute metadata.



4
5
6
# File 'lib/marksman/presentation.rb', line 4

def 
  @metadata
end

#slidesObject

Returns the value of attribute slides.



4
5
6
# File 'lib/marksman/presentation.rb', line 4

def slides
  @slides
end

#themeObject

Returns the value of attribute theme.



4
5
6
# File 'lib/marksman/presentation.rb', line 4

def theme
  @theme
end

Instance Method Details

#defaults(filename) ⇒ Object



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

def defaults(filename)
  {
    filename: filename,
    title: filename,
    theme: 'plain'
  }
end

#titleObject



13
14
15
# File 'lib/marksman/presentation.rb', line 13

def title
  @metadata[:title]
end