Class: Marksman::Presentation
- Inherits:
-
Object
- Object
- Marksman::Presentation
- Includes:
- Equality
- Defined in:
- lib/marksman/presentation.rb
Instance Attribute Summary collapse
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#slides ⇒ Object
Returns the value of attribute slides.
-
#theme ⇒ Object
Returns the value of attribute theme.
Instance Method Summary collapse
- #defaults(filename) ⇒ Object
-
#initialize(options) ⇒ Presentation
constructor
A new instance of Presentation.
- #title ⇒ Object
Methods included from Equality
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() @filename = [:filename] @slides = [:slides] || [] @metadata = defaults(filename).merge([:metadata] || {}) @theme = Theme.new @metadata[:theme] end |
Instance Attribute Details
#filename ⇒ Object
Returns the value of attribute filename.
4 5 6 |
# File 'lib/marksman/presentation.rb', line 4 def filename @filename end |
#metadata ⇒ Object
Returns the value of attribute metadata.
4 5 6 |
# File 'lib/marksman/presentation.rb', line 4 def @metadata end |
#slides ⇒ Object
Returns the value of attribute slides.
4 5 6 |
# File 'lib/marksman/presentation.rb', line 4 def @slides end |
#theme ⇒ Object
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 |
#title ⇒ Object
13 14 15 |
# File 'lib/marksman/presentation.rb', line 13 def title @metadata[:title] end |