Class: Text::Gen::Filter::Select
- Defined in:
- lib/text/gen/filter/select.rb
Overview
Select reduces the items in the array to only those with passing metadata. This happens before generation as opposed to ‘match` which applies a pass/fail to the result.
Instance Method Summary collapse
Methods inherited from Base
#component_key, filter_key, filter_name, #initialize, #key, #to_s, #type, #value
Constructor Details
This class inherits a constructor from Text::Gen::Filter::Base
Instance Method Details
#items(_context, items) ⇒ Object
10 11 12 13 14 |
# File 'lib/text/gen/filter/select.rb', line 10 def items(_context, items) items.select do |item| pass_select?(item["meta"]) end end |