Class: Tavola::Demonstrations

Inherits:
Object
  • Object
show all
Defined in:
lib/tavola/demonstrations.rb

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Demonstrations

Returns a new instance of Demonstrations.



10
11
12
# File 'lib/tavola/demonstrations.rb', line 10

def initialize config
  @config = config
end

Instance Method Details

#allObject



18
19
20
21
# File 'lib/tavola/demonstrations.rb', line 18

def all
  Dir[root.join('**/*.md')].map { |path|
    Demonstration.new(@config, path) }
end

#find(path) ⇒ Object



23
24
25
# File 'lib/tavola/demonstrations.rb', line 23

def find path
  Demonstration.new(@config, root.join(path))
end

#rootObject



14
15
16
# File 'lib/tavola/demonstrations.rb', line 14

def root
  root = @config.base_dir
end