title: Problem with Ruby blocks
body: <p>What is wrong in the code?</p>
  
  <pre><code>def call_block(n)
  
    if n==1
  
      return 0
    elsif n== 2
  
      return 1
    else
      yield
      return call_block(n-1) + call_block(n-2)
  
    end
  
  end
  
  
  puts call_block(10) {puts "Take this"}
  </code></pre>
  
  <p>I am trying to use yield to print  Take this other than the tenth fibonacci number.</p>
  
  <p>I am getting the error:
  in `call_block': no block given (LocalJumpError)</p>
  
  <p>Even the following code throws error:</p>
  
  <pre><code>def call_block(n)
  
    if n==1
      yield
      return 0
    elsif n== 2
      yield
      return 1
    else
      yield
      return call_block(n-1) + call_block(n-2)
  
    end
  
  end
  
  
  puts call_block(10) {puts "Take this"}
  </code></pre>