Method: Hyde::Set#except
- Defined in:
- lib/hyde/set.rb
#except(by = {}) ⇒ Object
Method: except (Hyde::Set) Filters a set by removing items matching the given metadata criteria.
This is the opposite of find.
## Example
Page['/'].children.find(layout: 'default')
26 27 28 29 30 |
# File 'lib/hyde/set.rb', line 26 def except(by={}) self.class.new(reject do |page| by.inject(true) { |b, (field, value)| b &&= (page..send(field) == value) } end) end |