Sha256: 6dd7baeceef76c05974f618e9680427cdd5fd325f7553d92939f915f7cf426d2

Contents?: true

Size: 695 Bytes

Versions: 3

Compression:

Stored size: 695 Bytes

Contents

# -*- encoding: UTF-8 -*-

module CSD
  module Extensions
    module Core
      # This module comprises extensions to Object (the parent of all classes).
      #
      module Object
        
        # Creates a Pathname object from the current object.
        #
        # ==== Examples
        #
        #  '/my/path'.pathnamify            # =>  #<Pathname:my/path>
        #  my_pathname_object.pathnamify    # =>  #<Pathname:my/path>
        #
        def pathnamify
          case self
            when ::Pathname then self
            else ::Pathname.new(self)
          end
        end
        
      end
    end
  end
end

class Object #:nodoc:
  include CSD::Extensions::Core::Object
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
csd-0.1.8 lib/csd/extensions/core/object.rb
csd-0.1.7 lib/csd/extensions/core/object.rb
csd-0.1.6 lib/csd/extensions/core/object.rb