Class: Fynd::Sieve
- Inherits:
-
Object
- Object
- Fynd::Sieve
- Defined in:
- lib/fynd/sieve.rb
Instance Attribute Summary collapse
-
#collection ⇒ Object
Returns the value of attribute collection.
-
#conditions ⇒ Object
Returns the value of attribute conditions.
-
#files ⇒ Object
Returns the value of attribute files.
Instance Method Summary collapse
-
#initialize ⇒ Sieve
constructor
A new instance of Sieve.
- #run ⇒ Object
Methods included from Tests
#amin, #anewer, #atime, #cmin, #cnewer, #ctime, #empty, #false, #gid, #group, #ilname, #iname, #inum, #iregex, #iwholename, #links, #lname, #mmin, #mtime, #name, #newer, #nogroup, #nouser, #path, #perm, #regex, #samefile, #size, #true, #type, #uid, #used, #user, #wholename, #xtype
Methods included from Operators
Methods included from Actions
#delete, #exec, #execdir, #fls, #fprint, #fprint0, #fprintf, #ok, #okdir, #print, #print0, #printf
Constructor Details
#initialize ⇒ Sieve
Returns a new instance of Sieve.
17 18 19 20 21 |
# File 'lib/fynd/sieve.rb', line 17 def initialize @collection = [] @conditions = {} @files = nil end |
Instance Attribute Details
#collection ⇒ Object
Returns the value of attribute collection.
15 16 17 |
# File 'lib/fynd/sieve.rb', line 15 def collection @collection end |
#conditions ⇒ Object
Returns the value of attribute conditions.
15 16 17 |
# File 'lib/fynd/sieve.rb', line 15 def conditions @conditions end |
#files ⇒ Object
Returns the value of attribute files.
15 16 17 |
# File 'lib/fynd/sieve.rb', line 15 def files @files end |
Instance Method Details
#run ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/fynd/sieve.rb', line 23 def run @files = collection.dup # first we match files with our tests conditions['tests'].each do |symbol, value| value.nil? ? self.__send__(symbol) : self.__send__(symbol, value) end @files end |