· software
Ruby 블록과 람다
Ruby 블록은 메서드 호출과 함께 코드 블록을 전달하는 방법입니다. ```ruby def call_block puts 'Start of method' yield puts 'End of method' end call_block { puts 'Inside the block' } ```
Ruby 블록은 메서드 호출과 함께 코드 블록을 전달하는 방법입니다. ```ruby def call_block puts 'Start of method' yield puts 'End of method' end call_block { puts 'Inside the block' } ```