Class SQLite3::Value
In: lib/sqlite3/value.rb
Parent: Object

Methods

length   new   null?   to_blob   to_f   to_i   to_int64   to_s   type  

Attributes

handle  [R] 

Public Class methods

[Source]

    # File lib/sqlite3/value.rb, line 40
40:     def initialize( db, handle )
41:       @driver = db.driver
42:       @handle = handle
43:     end

Public Instance methods

[Source]

    # File lib/sqlite3/value.rb, line 53
53:     def length( utf16=false )
54:       if utf16
55:         @driver.value_bytes16( @handle )
56:       else
57:         @driver.value_bytes( @handle )
58:       end
59:     end

[Source]

    # File lib/sqlite3/value.rb, line 45
45:     def null?
46:       type == :null
47:     end

[Source]

    # File lib/sqlite3/value.rb, line 49
49:     def to_blob
50:       @driver.value_blob( @handle )
51:     end

[Source]

    # File lib/sqlite3/value.rb, line 61
61:     def to_f
62:       @driver.value_double( @handle )
63:     end

[Source]

    # File lib/sqlite3/value.rb, line 65
65:     def to_i
66:       @driver.value_int( @handle )
67:     end

[Source]

    # File lib/sqlite3/value.rb, line 69
69:     def to_int64
70:       @driver.value_int64( @handle )
71:     end

[Source]

    # File lib/sqlite3/value.rb, line 73
73:     def to_s( utf16=false )
74:       @driver.value_text( @handle, utf16 )
75:     end

[Source]

    # File lib/sqlite3/value.rb, line 77
77:     def type
78:       case @driver.value_type( @handle )
79:         when Constants::ColumnType::INTEGER then :int
80:         when Constants::ColumnType::FLOAT   then :float
81:         when Constants::ColumnType::TEXT    then :text
82:         when Constants::ColumnType::BLOB    then :blob
83:         when Constants::ColumnType::NULL    then :null
84:       end
85:     end

[Validate]