Method: Vpim::DirectoryInfo#each
- Defined in:
- lib/vpim/dirinfo.rb
#each(cond = nil) ⇒ Object
Yields for each Field for which cond
.call(field) is true. The (default) cond
of nil is considered true for all fields, so this acts like a normal #each() when called with no arguments.
143 144 145 146 147 148 149 150 |
# File 'lib/vpim/dirinfo.rb', line 143 def each(cond = nil) # :yields: Field @fields.each do |field| if(cond == nil || cond.call(field)) yield field end end self end |