Sha256: 9908f7aa53d3fcc3ee861a1b413a4839e99e8a9664d959db3c8a1a1526b602a8

Contents?: true

Size: 341 Bytes

Versions: 3

Compression:

Stored size: 341 Bytes

Contents

require 'facets/functor'

class String

  # TODO: Should String#file be moved to functor gem?"

  # Use fluent notation for making file directives.
  #
  # For instance, if we had a file 'foo.txt',
  #
  #    'foo.txt'.file.mtime
  #
  def file
    f = self
    Functor.new do |op, *a, &b|
      File.send(op, f, *a, &b)
    end
  end

end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
facets-glimmer-3.2.0 lib/core/facets/string/file.rb
facets-3.1.0 lib/core/facets/string/file.rb
facets-3.0.0 lib/core/facets/string/file.rb