Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/sqlite3/statement.rb,
test/tc_integration.rb
Direct Known Subclasses
Instance Method Summary collapse
Instance Method Details
#from_utf16 ⇒ Object
15 16 17 18 19 20 21 |
# File 'test/tc_integration.rb', line 15 def from_utf16 result = "" length.times do |i| result << self[i,1] if i % 2 == 0 && self[i] != 0 end result end |
#to_blob ⇒ Object
5 6 7 |
# File 'lib/sqlite3/statement.rb', line 5 def to_blob SQLite3::Blob.new( self ) end |
#to_utf16(terminate = false) ⇒ Object
10 11 12 13 |
# File 'test/tc_integration.rb', line 10 def to_utf16(terminate=false) self.split(//).map { |c| c[0] }.pack("v*") + (terminate ? "\0\0" : "") end |