Class: Mysql::Result
Instance Method Summary collapse
- #each_hash_utf8(&block) ⇒ Object (also: #each_hash)
- #each_utf8(&block) ⇒ Object (also: #each)
- #encode(value, encoding = "utf-8") ⇒ Object
Instance Method Details
#each_hash_utf8(&block) ⇒ Object Also known as: each_hash
33 34 35 36 37 38 |
# File 'lib/joffice/mysql_utf8.rb', line 33 def each_hash_utf8(&block) each_hash_orig do |row| row.each {|k, v| row[k] = encode(v) } yield(row) end end |
#each_utf8(&block) ⇒ Object Also known as: each
25 26 27 28 29 |
# File 'lib/joffice/mysql_utf8.rb', line 25 def each_utf8(&block) each_orig do |row| yield row.map {|col| encode(col) } end end |