module FilepathList::EntriesMethods
Public Instance Methods
exclude(pattern = nil, &block)
click to toggle source
# File lib/filepath/filepathlist.rb, line 146 def exclude(pattern = nil, &block) if block_given? select { |e| !block.call(e) } else select { |e| !(e =~ pattern) } end end
map(&block)
click to toggle source
# File lib/filepath/filepathlist.rb, line 131 def map(&block) mapped_entries = @entries.map(&block) return FilepathList.new(mapped_entries) end
select(pattern = nil, &block)
click to toggle source
# File lib/filepath/filepathlist.rb, line 136 def select(pattern = nil, &block) if !block_given? block = proc { |e| e =~ pattern } end remaining_entries = @entries.select { |e| block.call(e) } return FilepathList.new(remaining_entries) end