Class: Briefing::Options

Inherits:
Hash
  • Object
show all
Defined in:
lib/briefing/slides.rb

Constant Summary collapse

REVEALJS_DEFAULTS =
{
  'controls'     => false,
  'progress'     => true,
  'history'      => true,
  'keyboard'     => true,
  'overview'     => true,
  'center'       => true,
  'loop'         => false,
  'rtl'          => false,
  'autoSlide'    => 0,
  'mouseWheel'   => false,
  'rollingLinks' => false
}

Instance Method Summary collapse

Constructor Details

#initialize(yaml_text) ⇒ Options

Returns a new instance of Options.



54
55
56
57
58
# File 'lib/briefing/slides.rb', line 54

def initialize(yaml_text)
  if options = YAML.load(yaml_text)
    self.merge! options
  end
end

Instance Method Details

#revealjsObject



60
61
62
63
64
65
66
# File 'lib/briefing/slides.rb', line 60

def revealjs
  options = {}
  REVEALJS_DEFAULTS.each_pair {|key, value|
    options[key] = self[key] || value
  }
  options
end