Class: Wingtips::Configuration
- Inherits:
-
Object
- Object
- Wingtips::Configuration
- Includes:
- DSL
- Defined in:
- lib/wingtips/configuration.rb
Class Attribute Summary collapse
-
.current ⇒ Object
Returns the value of attribute current.
Instance Attribute Summary collapse
-
#app_options ⇒ Object
readonly
Returns the value of attribute app_options.
-
#slide_classes ⇒ Object
readonly
Returns the value of attribute slide_classes.
Instance Method Summary collapse
-
#initialize(path) ⇒ Configuration
constructor
A new instance of Configuration.
- #slides(*slide_classes) ⇒ Object
- #startup_options(opts = {}) ⇒ Object
- #unnamed_slides_allowed? ⇒ Boolean
Methods included from DSL
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.(path) load_templates full_path 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
.current ⇒ Object
Returns the value of attribute current.
38 39 40 |
# File 'lib/wingtips/configuration.rb', line 38 def current @current end |
Instance Attribute Details
#app_options ⇒ Object (readonly)
Returns the value of attribute app_options.
5 6 7 |
# File 'lib/wingtips/configuration.rb', line 5 def @app_options end |
#slide_classes ⇒ Object (readonly)
Returns the value of attribute slide_classes.
5 6 7 |
# File 'lib/wingtips/configuration.rb', line 5 def @slide_classes end |
Instance Method Details
#slides(*slide_classes) ⇒ Object
29 30 31 |
# File 'lib/wingtips/configuration.rb', line 29 def (*) @slide_classes.concat() end |
#startup_options(opts = {}) ⇒ Object
25 26 27 |
# File 'lib/wingtips/configuration.rb', line 25 def (opts={}) @app_options.merge!(opts) end |
#unnamed_slides_allowed? ⇒ Boolean
33 34 35 |
# File 'lib/wingtips/configuration.rb', line 33 def @allow_unnamed_slides end |