Confuse about the include keyword


#1

Quick question: I noticed that in order to include a module the keyword include must be used(i.e. include 'date') to be able to use the Date method inside that module but how come for the Math module you don't have to? are there other like it? in exercise 11 (OOP II, Feeling included) when i typed include'Math' it threw an error and the only thing I recognize is that we including Math inside of a class, is that why?

just need some clarification on the exact syntax of the include keyword or when quotes are needed and when not.

Thanks in advance.


#2

@scriptblaster60141
Well if you are so curious you should start reading
https://en.wikibooks.org/wiki/Ruby_Programming/Syntax/Classes
http://stackoverflow.com/questions/5364303/do-i-need-to-call-the-math-class-directly
http://stackoverflow.com/questions/318144/what-is-the-difference-between-include-and-require-in-ruby


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.