Skip to content

Instantly share code, notes, and snippets.

View ParadoxV5's full-sized avatar
🌻
Google Summer of Code 2024

ParadoxV5

🌻
Google Summer of Code 2024
View GitHub Profile
@havenwood
havenwood / each.rb
Created July 5, 2022 18:44
An example of why we use `each` rather than `for` and what semicolon block args do for #ruby IRC
foo = :untouched
bar = :untouched
[:touched].each do |foo|
bar = :touched
end
foo #=> :untouched
bar #=> :touched
@havenwood
havenwood / super.rb
Created May 25, 2018 17:54
Example's of how Ruby's super keyword passes on args and blocks
class Foo
def foo arg = false
{arg: arg, block: block_given?}
end
end
class Bar < Foo
def foo *args
super
end