Sha256: 1c5f644c71e3247f34c872d5dc29efa62d89839657fc8634688a6ab9b9d113b7

Contents?: true

Size: 827 Bytes

Versions: 24

Compression:

Stored size: 827 Bytes

Contents

# -*- encoding: UTF-8 -*-
require 'csd/vendor/active_support/object_extensions'

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
            when NilClass then raise ::CSD::Error::Internal::PathnamifyingNil
            else ::Pathname.new(self)
          end
        end
        
      end
    end
  end
end

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

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
csd-0.4.3 lib/csd/extensions/core/object.rb
csd-0.4.2 lib/csd/extensions/core/object.rb
csd-0.4.1 lib/csd/extensions/core/object.rb
csd-0.4.0 lib/csd/extensions/core/object.rb
csd-0.3.7 lib/csd/extensions/core/object.rb
csd-0.3.6 lib/csd/extensions/core/object.rb
csd-0.3.5 lib/csd/extensions/core/object.rb
csd-0.3.4 lib/csd/extensions/core/object.rb
csd-0.3.3 lib/csd/extensions/core/object.rb
csd-0.3.2 lib/csd/extensions/core/object.rb
csd-0.3.1 lib/csd/extensions/core/object.rb
csd-0.3.0 lib/csd/extensions/core/object.rb
csd-0.2.2 lib/csd/extensions/core/object.rb
csd-0.2.1 lib/csd/extensions/core/object.rb
csd-0.2.0 lib/csd/extensions/core/object.rb
csd-0.1.18 lib/csd/extensions/core/object.rb
csd-0.1.17 lib/csd/extensions/core/object.rb
csd-0.1.16 lib/csd/extensions/core/object.rb
csd-0.1.15 lib/csd/extensions/core/object.rb
csd-0.1.14 lib/csd/extensions/core/object.rb