Method: File.if_readable
- Defined in:
- lib/lab42/core/file.rb
.if_readable(path, &blk) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/lab42/core/file.rb', line 11 def if_readable path, &blk return Lab42::File.enumerate_on_file_readable path unless blk return unless readable? path return blk.() if blk.arity.zero? File.open path, &blk end |