1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
def record_class
  raise unless @record_class =~ /\A(?:\w+::)*\w+\Z/
  eval(@record_class)
end

class Ouch
  def =~(*args)
    true
  end
  
  def to_str
    %Q{p "You are fucked."}
  end
end

@record_class = Ouch.new
record_class
# >> "You are fucked."