public
Fork of sam/dm-core
Description: DataMapper - Core
Homepage: http://datamapper.org
Clone URL: git://github.com/thewordnerd/dm-core.git
dm-core / lib / dm-core / types / binary.rb
100644 15 lines (12 sloc) 0.338 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module DataMapper
  module Types
    class Binary < DataMapper::Type
      primitive Extlib::ByteArray
      lazy true
 
      def self.dump(value, property)
        return nil if value.nil?
        return Extlib::ByteArray.new(value) if value.class == String
      end
 
    end # class Binary
  end # module Types
end # module DataMapper