Skip to content

Latest commit

 

History

History
17 lines (14 loc) · 327 Bytes

yield_to_the_block.md

File metadata and controls

17 lines (14 loc) · 327 Bytes

Description

Complete the Compute method/function so that if a block is given it will run else it returns "Do not compute".

def compute
  yield
end

My Solution

def compute
  block_given? ? yield : "Do not compute"
end