Module: Jekyll::Filters::Compact
- Defined in:
- lib/jekyll/filters/compact.rb
Instance Method Summary collapse
-
#compact(array) ⇒ Array
Removes nil values from an Array.
Instance Method Details
#compact(array) ⇒ Array
Removes nil values from an Array
Example usage:
βtag,,tag2β | split: β,β | compact }
14 15 16 17 18 19 20 21 22 |
# File 'lib/jekyll/filters/compact.rb', line 14 def compact(array) return [] unless array.is_a? Array @cache = Jekyll::Cache.new('Jekyll::Filters::Compact') @cache.getset(array.hash.to_s) do array.compact end end |