Class: Revealize::FileSystemStore

Inherits:
Object
  • Object
show all
Defined in:
lib/revealize/file_system_store.rb

Constant Summary collapse

SLIDE_DECKS_DIR =
'slide_decks'
SLIDES_DIR =
'slides'
LAYOUTS_DIR =
'layouts'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(root_path, slide_deck = nil) ⇒ FileSystemStore

Returns a new instance of FileSystemStore.



22
23
24
25
# File 'lib/revealize/file_system_store.rb', line 22

def initialize(root_path, slide_deck=nil)
  @root_path = root_path
  @deck = slide_deck
end

Instance Attribute Details

#deckObject (readonly)

Returns the value of attribute deck.



20
21
22
# File 'lib/revealize/file_system_store.rb', line 20

def deck
  @deck
end

#root_pathObject (readonly)

Returns the value of attribute root_path.



20
21
22
# File 'lib/revealize/file_system_store.rb', line 20

def root_path
  @root_path
end

Instance Method Details

#decksObject



27
28
29
# File 'lib/revealize/file_system_store.rb', line 27

def decks
  DeckList.new *deck_names
end

#read_deck(deck_name) ⇒ Object



31
32
33
34
# File 'lib/revealize/file_system_store.rb', line 31

def read_deck(deck_name)
  SlideDeckDsl.new(self).instance_eval(deck_file(deck_name))
  @deck
end

#read_layout(layout_name) ⇒ Object



36
37
38
# File 'lib/revealize/file_system_store.rb', line 36

def read_layout(layout_name)
  @deck = SlideDeck.new(DeckTemplate.new(layout_file(layout_name)))
end

#read_slide(slide_name) ⇒ Object



40
41
42
# File 'lib/revealize/file_system_store.rb', line 40

def read_slide(slide_name)
  @deck.add_slide(create_slide(slide_name))
end