Class: Jekyll::Menus::Drops::All

Inherits:
Liquid::Drop
  • Object
show all
Defined in:
lib/jekyll/menus/drops/all.rb

Instance Method Summary collapse

Constructor Details

#initialize(menus) ⇒ All

Returns a new instance of All.



9
10
11
# File 'lib/jekyll/menus/drops/all.rb', line 9

def initialize(menus)
  @menus = menus
end

Instance Method Details

#[](key) ⇒ Object



41
42
43
44
45
46
47
# File 'lib/jekyll/menus/drops/all.rb', line 41

def [](key)
  if @menus.key?(key)
    then Menu.new(@menus[key],
      key, self
    )
  end
end

#eachObject



33
34
35
36
37
# File 'lib/jekyll/menus/drops/all.rb', line 33

def each
  to_a.each do |drop|
    yield drop
  end
end

#findObject



15
16
17
18
19
# File 'lib/jekyll/menus/drops/all.rb', line 15

def find
  to_a.find do |menu|
    yield menu
  end
end

#to_aObject



23
24
25
26
27
28
29
# File 'lib/jekyll/menus/drops/all.rb', line 23

def to_a
  @menus.keys.map do |identifier|
    self[
      identifier
    ]
  end
end