Module or Mix-in used as a Namespace in ruby. It is used to avoid collision between two classes.
module Rajkumar
class Uthayaa
attr_accessor :email
def display_email
puts "my email is #{@email}"
end
end
end
module Somu
class Uthayaa
attr_accessor :email
def display_email
puts "my email 2 is #{@email}"
end
end
end
puts raj = Rajkumar::Uthayaa.new
puts raj.email='rajutaya@gmail.com'
puts raj.display_email
puts raj = Somu::Uthayaa.new
puts raj.email='lalalslsls@gmail.com'
puts raj.display_email