include? in?
rand(3) 随机数 0-2
flatten 数组扁平化
字符串字符迭代 each_byte 行迭代 each_line
define? a
begin rescure else ensure end
attr_reader attr_write attr_accessor
拼音排序(有递归)a.partition{ |x| x.is_a?String }.map(&:sort).flatten
methods
respond_to?
method_defined?
Time.now.strftime("%Y-%m-%d %H:%M:%S")
ActiveRecord::Base.connection.exec_query(sql)
ActiveRecord::Base.connection.execute(sql)
object_id和equal?关注对象的identity
==和eql?关注对象的value
You must use Bundler 2 or greater with this lockfile. (Bundler::LockfileError)
安装
gem update --system
gem install bundler
bundler update --bundler
卸载
gem uninstall bundler
rails plugin new xxx 创建rails插件
rake install 或者 rails install 打包成gem