class Test
def setup
end
def initialize
setup
end
end
class Common < Test
def test_no_id
puts "Inside #{self} it is #{@state}"
end
end
class A < Common
def setup
@state = "A"
end
end
class B < Common
def setup
@state = "B"
end
end
A.new.test_no_id
B.new.test_no_id
Y2xhc3MgVGVzdAogIGRlZiBzZXR1cAogIGVuZAoKICBkZWYgaW5pdGlhbGl6ZQogICAgc2V0dXAKICBlbmQKZW5kCgpjbGFzcyBDb21tb24gPCBUZXN0CiAgZGVmIHRlc3Rfbm9faWQKICAgIHB1dHMgIkluc2lkZSAje3NlbGZ9IGl0IGlzICN7QHN0YXRlfSIKICBlbmQKZW5kCgpjbGFzcyBBIDwgQ29tbW9uCiAgZGVmIHNldHVwCiAgICBAc3RhdGUgPSAiQSIKICBlbmQKZW5kCgpjbGFzcyBCIDwgQ29tbW9uCiAgZGVmIHNldHVwCiAgICBAc3RhdGUgPSAiQiIKICBlbmQKZW5kCgpBLm5ldy50ZXN0X25vX2lkCkIubmV3LnRlc3Rfbm9faWQK