Class Amalgalite::TypeMaps::StorageMap
In: lib/amalgalite/type_maps/storage_map.rb
Parent: ::Amalgalite::TypeMap

An Amalagliate TypeMap that has a one-to-one conversion between SQLite types and Ruby classes

Methods

Public Instance methods

A straight logical mapping (for me at least) of basic Ruby classes to SQLite types, if nothing can be found then default to TEXT.

[Source]

    # File lib/amalgalite/type_maps/storage_map.rb, line 19
19:     def bind_type_of( obj )
20:       case obj
21:       when Float
22:         ::Amalgalite::SQLite3::Constants::DataType::FLOAT
23:       when Fixnum
24:         ::Amalgalite::SQLite3::Constants::DataType::INTEGER
25:       when NilClass
26:         ::Amalgalite::SQLite3::Constants::DataType::NULL
27:       when ::Amalgalite::Blob
28:         ::Amalgalite::SQLite3::Constants::DataType::BLOB
29:       else
30:         ::Amalgalite::SQLite3::Constants::DataType::TEXT
31:       end
32:     end

Do no mapping, just return the value as it was retrieved from SQLite.

[Source]

    # File lib/amalgalite/type_maps/storage_map.rb, line 37
37:     def result_value_of( delcared_type, value )
38:       return value
39:     end

[Validate]