0

I normally use class_eval do with the block but also saw examples like follows, Im trying to understand in what scenario I should use them, specifically <<-READER and <<-M

class_eval <<-READER, __FILE__ , __LINE__ + 1
  def #{sym}
    @#{sym}
  end
READER

OR

class_eval <<-M, __FILE__ , __LINE__ + 1
  def m
  end
M
user1883793
  • 3,577
  • 11
  • 33
  • 61

0 Answers0