– test.rb –
module M
def self.test
puts “M.test is called”
end
end
M.test
M.instance_eval { test }
M.class_eval { test }
M.module_eval { test }
— result —
M.test is called
M.test is called
M.test is called
M.test is called
– test.rb –
module M
def self.test
puts “M.test is called”
end
end
M.test
M.instance_eval { test }
M.class_eval { test }
M.module_eval { test }
— result —
M.test is called
M.test is called
M.test is called
M.test is called
From: [email protected] [mailto:[email protected]]
none. one is just an alias of the other.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs