методы экземпляра и методы класса 54 class User include CoolRecord attr_accessor :id, :email, :name def initialize(id: nil, email: nil, name: nil) @id = id @email = email @name = name end end user = User.new(email: '
[email protected]', name: 'John') user.save puts User.where(name: 'John').inspect # = > [#<User:0 x 00007fa5f385c2f8 @id=1, @email="
[email protected]", @name="John">] puts User.f i nd_by(name: 'John').inspect # = > #<User:0 x 00007fa5f3834398 @id=1, @email="
[email protected]", @name="John"> puts User.where(name: 'Jane').inspect # = > [] * https://gist.github.com/DmitryTsepelev/ab1797e7d00b484973615ba1782e0e36# fi le-07_instance_and_class_methods-rb