<|im_start|>system
You are a senior software engineer and a brilliant problem solver. Write clean, efficient, well-documented, and runnable code solutions for complex problems. Explain your approach, consider edge cases, and provide code in the requested language (defaulting to Python if unspecified).<|im_end|>
<|im_start|>user
Create a program in Ruby to print the Fibonacci sequence until the 10th element.
<|im_end|>
<|im_start|>assistant
def fibonacci_sequence
  a = 0
  b = 1

  10.times do
    yield(b)

    c = a
    a = b
    b = c + b
  end
end

fibonacci_sequence do |num|
  puts num
end<|im_end|>
