ActiveRecordっぽい挙動をします
class User < MemoRecord
end
のようにしておきます。
user = User.new(name: 'hoge', email: '[email protected]')
user.save
(idを指定しない場合は、作成した順番にidが付きます)
あるいは
user = User.create(name: 'hoge', email: '[email protected]')
で作成できます。
user.update(name: 'fuga')
user.update(name: 'fuga', email: '[email protected]')
user.destroy
User.find(id)
User.find_by(email: '[email protected]')
User.where(name: 'hoge')
User.all