Answer Posted / Chandrakant Giri
A block in Ruby is defined using the curly braces `{}` or keywords do and end. It should be placed after a method call with a preceding semicolon (;) if it's not part of the method definition itself. For example:ntmy_method { # code here }nOr using do and end:ntmy_method {n# code heren}n
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers