Class DBI::ColumnInfo
In: lib/dbi/columninfo.rb
Parent: DelegateClass(Hash)

This represents metadata for columns within a given table, such as the data type, whether or not the the column is a primary key, etc.

ColumnInfo is a delegate of Hash, but represents its keys indifferently, coercing all strings to symbols. It also has ostruct-like features, f.e.:

  h ={ "foo" => "bar" })
  h[:foo] => "bar"
  h["foo"] => "bar" => "bar"

All of these forms have assignment forms as well.


[]   []=   default   method_missing   new  

Public Class methods

Create a new ColumnInfo object.

If no Hash is provided, one will be created for you. The hash will be shallow cloned for storage inside the object, and an attempt will be made to convert all string keys to symbols.

In the event that both string and symbol keys are provided in the initial hash, we cannot safely route around collisions and therefore a TypeError is raised.

Public Instance methods