Skip to content

Latest commit

 

History

History
38 lines (29 loc) · 520 Bytes

README.md

File metadata and controls

38 lines (29 loc) · 520 Bytes

My 4 Favorite Ruby Methods

yield

You can do something, but you don't know what it is doing, but it works... sorta

x = 0
while x < 1
  yield
  x += 1
  end

detect

You can detect that this might be useful

useful.detect(is_it?) = false

until

Always useful until its not

until x==useful
  do |useful|
    x = useful
    end
end

each

helpful unless you need something, then you should have mapped

array.each