Class: Tavola::Demonstrations
- Inherits:
-
Object
- Object
- Tavola::Demonstrations
- Defined in:
- lib/tavola/demonstrations.rb
Instance Method Summary collapse
- #all ⇒ Object
- #find(path) ⇒ Object
-
#initialize(config) ⇒ Demonstrations
constructor
A new instance of Demonstrations.
- #root ⇒ Object
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
#all ⇒ Object
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 |
#root ⇒ Object
14 15 16 |
# File 'lib/tavola/demonstrations.rb', line 14 def root root = @config.base_dir end |