Why some methods have '::'

1

Why some methods such as Perl or Ruby: Net::FTP , have these two points; how is the construction of the methods of this class and why it is created this way (with this syntax) and not of the form currently used by current libraries: HTTParty.get() , requests.get() ?

    
asked by anonymous 12.03.2017 / 04:12

1 answer

3

This has nothing to do with method, but with the class and its namespace . FTP is the class and it will contain methods. Net is just the last name of this class. Namespaces are like modules containing class, but not exactly. In some languages it is confused with a class package that has a slightly different concept, the exact way each language should be seen in its documentation.

It has an explanation of How do namespaces work in C #? . The language has chosen to use the namespaces point as well, but the idea is the same.

    
12.03.2017 / 07:10