Class: RevealCK::Presentation
- Inherits:
-
Object
- Object
- RevealCK::Presentation
- Extended by:
- Forwardable
- Includes:
- Retrieve
- Defined in:
- lib/reveal-ck/presentation.rb
Overview
Public: A Presentation is slide html and metadata. Access html via #html. Access metadata via theme, title, author, transition.
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#html ⇒ Object
Returns the value of attribute html.
Class Method Summary collapse
Instance Method Summary collapse
- #add(content) ⇒ Object
-
#initialize(args) ⇒ Presentation
constructor
A new instance of Presentation.
- #revealjs_config ⇒ Object
Methods included from Retrieve
Constructor Details
#initialize(args) ⇒ Presentation
Returns a new instance of Presentation.
21 22 23 24 |
# File 'lib/reveal-ck/presentation.rb', line 21 def initialize(args) @html = '' @config = retrieve(:config, args) end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
19 20 21 |
# File 'lib/reveal-ck/presentation.rb', line 19 def config @config end |
#html ⇒ Object
Returns the value of attribute html.
19 20 21 |
# File 'lib/reveal-ck/presentation.rb', line 19 def html @html end |
Class Method Details
.from_dsl(args) ⇒ Object
38 39 40 41 |
# File 'lib/reveal-ck/presentation.rb', line 38 def self.from_dsl(args) file, config = retrieve(:file, args), retrieve(:config, args) RevealCK::PresentationDSL.load file: file, config: config end |
.from_template(args) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/reveal-ck/presentation.rb', line 30 def self.from_template(args) file, config = retrieve(:file, args), retrieve(:config, args) presentation = Presentation.new config: config template = Templates::Processor.open(file: file, config: config) presentation.html = template.output presentation end |
.load(args) ⇒ Object
43 44 45 46 47 48 49 50 |
# File 'lib/reveal-ck/presentation.rb', line 43 def self.load(args) file, config = retrieve(:file, args), retrieve(:config, args) if file.end_with? '.rb' Presentation.from_dsl file: file, config: config else Presentation.from_template file: file, config: config end end |
Instance Method Details
#add(content) ⇒ Object
26 27 28 |
# File 'lib/reveal-ck/presentation.rb', line 26 def add(content) @html << content.html end |
#revealjs_config ⇒ Object
15 16 17 |
# File 'lib/reveal-ck/presentation.rb', line 15 def revealjs_config @config.revealjs_config end |