D
Durga B.
I read some materials about modules that is modules are combination of
classes and modules so i made a example but it gives error"undefined
method `run' for #<Man:0x2c2bbc0> (NoMethodError)" .I want call run
method in Module1_Class in Module1,is it possible i call run method
using Man class object.
module Module1
class Module1_Class
def run
puts "I'm running! in Module1"
end
def walk
puts "I'm walking a bit briskly!"
end
end
def crawl
puts "I'm so slowwww!"
end
end
class Man
include Module1
def jump
puts "I'm bipedal and I can jump like a fool!"
end
end
mister_man = Man.new
mister_man.run
classes and modules so i made a example but it gives error"undefined
method `run' for #<Man:0x2c2bbc0> (NoMethodError)" .I want call run
method in Module1_Class in Module1,is it possible i call run method
using Man class object.
module Module1
class Module1_Class
def run
puts "I'm running! in Module1"
end
def walk
puts "I'm walking a bit briskly!"
end
end
def crawl
puts "I'm so slowwww!"
end
end
class Man
include Module1
def jump
puts "I'm bipedal and I can jump like a fool!"
end
end
mister_man = Man.new
mister_man.run