Module: Hashrocket::Wireframe::Filter
- Defined in:
- app/models/hashrocket/wireframe.rb
Instance Method Summary collapse
Instance Method Details
#filter(rules) ⇒ Object
48 49 50 51 52 53 54 |
# File 'app/models/hashrocket/wireframe.rb', line 48 def filter(rules) select do |wireframe| rules.all? do |rule| pass?(rule, wireframe.name) end end end |
#pass?(rule, filename) ⇒ Boolean
40 41 42 43 44 45 46 |
# File 'app/models/hashrocket/wireframe.rb', line 40 def pass?(rule, filename) if rule.respond_to? :call !rule[filename] else filename != rule end end |