File: binary.rb

package info (click to toggle)
libdbi-ruby 0.4.3-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 472 kB
  • ctags: 619
  • sloc: ruby: 4,583; makefile: 62; perl: 12
file content (25 lines) | stat: -rw-r--r-- 685 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
module DBI
    #
    # Encapsulates the concept of a CLOB/BLOB, which can then be passed as a
    # bind via BaseStatement#bind_param.
    #
    # This is similar to a DBI::Type class and will eventually find its way
    # there.
    #
    # See #new for usage.
    class Binary
        attr_accessor :data

        # Construct a new DBI::Binary object with the data supplied as string.
        # This object can then be used in bound variables to represent a CLOB
        # or BLOB type.
        def initialize(data)
            @data = data
        end

        # Return the string representation of the DBI::Binary object.
        def to_s
            @data
        end
    end
end