Sha256: 176fe237df57885a184f82867c21fc9575ffbe2a1f252c691b1f819eefd6dc09
Contents?: true
Size: 588 Bytes
Versions: 12
Compression:
Stored size: 588 Bytes
Contents
require 'pathname' module DataMapper module Types class FilePath < DataMapper::Type primitive String def self.load(value, property) if value.nil? nil else Pathname.new(value) end end def self.dump(value, property) return nil if value.nil? value.to_s end def self.typecast(value, property) # Leave alone if a Pathname is given. value.kind_of?(Pathname) ? value : load(value, property) end end # class FilePath end # module Types end # module DataMapper
Version data entries
12 entries across 12 versions & 2 rubygems