Class: Jekyll::Menus::Drops::All
- Inherits:
-
Liquid::Drop
- Object
- Liquid::Drop
- Jekyll::Menus::Drops::All
- Defined in:
- lib/jekyll/menus/drops/all.rb
Instance Method Summary collapse
- #[](key) ⇒ Object
- #each ⇒ Object
- #find ⇒ Object
-
#initialize(menus) ⇒ All
constructor
A new instance of All.
- #to_a ⇒ Object
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 = 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 |
#each ⇒ Object
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 |
#find ⇒ Object
15 16 17 18 19 |
# File 'lib/jekyll/menus/drops/all.rb', line 15 def find to_a.find do || yield end end |
#to_a ⇒ Object
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 |