Class: DBI::Binary

Inherits:
Object
  • Object
show all
Defined in:
lib/dbi/binary.rb

Overview

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.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Binary

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.



16
17
18
# File 'lib/dbi/binary.rb', line 16

def initialize(data)
    @data = data
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



11
12
13
# File 'lib/dbi/binary.rb', line 11

def data
  @data
end

Instance Method Details

#to_sObject

Return the string representation of the DBI::Binary object.



21
22
23
# File 'lib/dbi/binary.rb', line 21

def to_s
    @data
end