This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rails_helper' | |
class Person | |
attr_reader( | |
:first_name, | |
:last_name, | |
:age, | |
:country | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This change breaks ruby 2.7 REPL a.k.a IRB. | |
# Reason is here https://github.com/ruby/irb/issues/64 | |
class Symbol | |
def to_proc(*args) | |
proc {} | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_relative 'lib' | |
str = 'string' | |
p Str.call.equal?(str) # Try to predict result and than add # frozen_string_literal: true and run app.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
class Human | |
# What does this mean? Who is owner of this instance variable? | |
@created_humans = [] | |
@@humans_count = 0 | |
# What does mean this instruction | |
class << self | |
attr_accessor :created_humans |