class Test
end
class Common < Test
class << self
attr_reader :state
end
def test_no_id
puts "Inside #{self} it is #{self.class.state}"
end
end
class A < Common
@state = "A"
end
class B < Common
@state = "B"
end
A.new.test_no_id
B.new.test_no_id
Y2xhc3MgVGVzdAplbmQKCmNsYXNzIENvbW1vbiA8IFRlc3QKICBjbGFzcyA8PCBzZWxmCiAgICBhdHRyX3JlYWRlciA6c3RhdGUKICBlbmQKCiAgZGVmIHRlc3Rfbm9faWQKICAgIHB1dHMgIkluc2lkZSAje3NlbGZ9IGl0IGlzICN7c2VsZi5jbGFzcy5zdGF0ZX0iCiAgZW5kCmVuZAoKY2xhc3MgQSA8IENvbW1vbgogIEBzdGF0ZSA9ICJBIgplbmQKCmNsYXNzIEIgPCBDb21tb24KICBAc3RhdGUgPSAiQiIKZW5kCgpBLm5ldy50ZXN0X25vX2lkCkIubmV3LnRlc3Rfbm9faWQK