Class: SQLite3::Value

### Home Classes Methods

### In Files

- lib/sqlite3/value.rb

### Parent

Object

### Methods

- ::new
- #length
- #null?
- #to_blob
- #to_f
- #to_i
- #to_int64
- #to_s
- #type

### Files

- API_CHANGES.rdoc
- Manifest.txt
- README.rdoc

### Class/Module Index

Quicksearch

- SQLite3
- SQLite3::AbortException
- SQLite3::AuthorizationException
- SQLite3::Backup
- SQLite3::Blob
- SQLite3::BusyException
- SQLite3::CantOpenException
- SQLite3::Constants
- SQLite3::Constants::ColumnType
- SQLite3::Constants::ErrorCode
- SQLite3::Constants::TextRep
- SQLite3::ConstraintException
- SQLite3::CorruptException
- SQLite3::Database
- SQLite3::Database::FunctionProxy
- SQLite3::EmptyException
- SQLite3::Exception
- SQLite3::FormatException
- SQLite3::FullException
- SQLite3::IOException
- SQLite3::InternalException
- SQLite3::InterruptException
- SQLite3::LockedException
- SQLite3::MemoryException
- SQLite3::MismatchException
- SQLite3::MisuseException
- SQLite3::NotADatabaseException
- SQLite3::NotFoundException
- SQLite3::PermissionException
- SQLite3::Pragmas
- SQLite3::ProtocolException
- SQLite3::RangeException
- SQLite3::ReadOnlyException
- SQLite3::ResultSet
- SQLite3::SQLException
- SQLite3::SchemaChangedException
- SQLite3::Statement
- SQLite3::TooBigException
- SQLite3::Translator
- SQLite3::UnsupportedException
- SQLite3::Value
- SQLite3::VersionProxy
- String

No matching classes.

# SQLite3::Value

### Attributes

handle[R]

### Public Class Methods

new( db, handle ) click to toggle source

    # File lib/sqlite3/value.rb, line 8
    def initialize( db, handle )
      @driver = db.driver
      @handle = handle
    end

### Public Instance Methods

length( utf16=false ) click to toggle source

    # File lib/sqlite3/value.rb, line 21
    def length( utf16=false )
      if utf16
        @driver.value_bytes16( @handle )
      else
        @driver.value_bytes( @handle )
      end
    end

null?() click to toggle source

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

to_blob() click to toggle source

    # File lib/sqlite3/value.rb, line 17
    def to_blob
      @driver.value_blob( @handle )
    end

to_f() click to toggle source

    # File lib/sqlite3/value.rb, line 29
    def to_f
      @driver.value_double( @handle )
    end

to_i() click to toggle source

    # File lib/sqlite3/value.rb, line 33
    def to_i
      @driver.value_int( @handle )
    end

to_int64() click to toggle source

    # File lib/sqlite3/value.rb, line 37
    def to_int64
      @driver.value_int64( @handle )
    end

to_s( utf16=false ) click to toggle source

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

type() click to toggle source

    # File lib/sqlite3/value.rb, line 45
    def type
      case @driver.value_type( @handle )
        when Constants::ColumnType::INTEGER then :int
        when Constants::ColumnType::FLOAT   then :float
        when Constants::ColumnType::TEXT    then :text
        when Constants::ColumnType::BLOB    then :blob
        when Constants::ColumnType::NULL    then :null
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.