Class/Module Index [+]

Quicksearch

Amalgalite::TypeMaps::StorageMap

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

Public Instance Methods

bind_type_of( obj ) click to toggle source

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

# File lib/amalgalite/type_maps/storage_map.rb, line 18
def bind_type_of( obj )
  case obj
  when Float
    ::Amalgalite::SQLite3::Constants::DataType::FLOAT
  when Fixnum
    ::Amalgalite::SQLite3::Constants::DataType::INTEGER
  when NilClass
    ::Amalgalite::SQLite3::Constants::DataType::NULL
  when ::Amalgalite::Blob
    ::Amalgalite::SQLite3::Constants::DataType::BLOB
  else
    ::Amalgalite::SQLite3::Constants::DataType::TEXT
  end
end
result_value_of( delcared_type, value ) click to toggle source

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

# File lib/amalgalite/type_maps/storage_map.rb, line 36
def result_value_of( delcared_type, value )
  return value
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.