Class: JekyllBlocker::BlockCollection

Inherits:
Object
  • Object
show all
Defined in:
lib/jekyll-blocker/block_collection.rb

Instance Method Summary collapse

Constructor Details

#initialize(folder) ⇒ BlockCollection

Returns a new instance of BlockCollection.



3
4
5
6
7
8
9
# File 'lib/jekyll-blocker/block_collection.rb', line 3

def initialize(folder)
  @blocks = {}
  @path = File.join(folder, "_blocker", "blocks")

  paths = Dir[File.join(@path, "**", "*.{html,liquid}")]
  paths.each { |path| load_block(path) }
end

Instance Method Details

#find(name) ⇒ Object



11
12
13
# File 'lib/jekyll-blocker/block_collection.rb', line 11

def find(name)
  @blocks[name]
end