Skip to content

Instantly share code, notes, and snippets.

Avatar

Pasha Bratanov zgfif

View GitHub Profile
View superhero.rb
require 'active_model'
class Superhero
include ActiveModel::Validations
attr_accessor :name, :age
def initialize **args
@name = args[:name]
View method.rb
class Arsenal
def self.hello
'Hello as class method!'
end
def mymy
'Arsen Wenger'
end
View superhero_2_0.rb
require 'active_model'
class Superhero
include ActiveModel::Validations
@@total = []
attr_reader :name, :age
def initialize name, age
@name = name