lib/sequel/adapters/cubrid.rb in sequel-4.21.0 vs lib/sequel/adapters/cubrid.rb in sequel-4.22.0

- old
+ new

@@ -4,11 +4,11 @@ module Sequel module Cubrid CUBRID_TYPE_PROCS = { ::Cubrid::DATE => lambda{|t| Date.new(t.year, t.month, t.day)}, ::Cubrid::TIME => lambda{|t| SQLTime.create(t.hour, t.min, t.sec)}, - 21 => lambda{|s| s.to_i} + 21 => lambda(&:to_i) } class Database < Sequel::Database include Sequel::Cubrid::DatabaseMethods @@ -29,11 +29,11 @@ conn.auto_commit = true conn end def server_version - @server_version ||= synchronize{|c| c.server_version} + @server_version ||= synchronize(&:server_version) end def execute(sql, opts=OPTS) synchronize(opts[:server]) do |conn| r = log_yield(sql) do @@ -123,10 +123,10 @@ def fetch_rows(sql) execute(sql) do |stmt| begin cols = stmt.column_info.map{|c| [output_identifier(c[COLUMN_INFO_NAME]), CUBRID_TYPE_PROCS[c[COLUMN_INFO_TYPE]]]} - @columns = cols.map{|c| c.first} + @columns = cols.map(&:first) stmt.each do |r| row = {} cols.zip(r).each{|(k, p), v| row[k] = (v && p) ? p.call(v) : v} yield row end