Here is the exact code that you are using under the hood:
As you can see, there are nested modules/classes:
class Bucket < Base
- AWS is a module.
- S3 is a module.
- Bucket is a class.
The class Bucket is nested inside the module S3 which is nested inside the module AWS.
A Module is basically a bundle of methods/constants, but they differ from classes in the sense where they can't have instances. You use that a lot in order to refactor your code and to better design it. More information on Modules here.
The :: is used to refer to the nested modules/classes. It's a kind of resolution operator, that helps you reach your nested modules/classes/constants by knowing their paths.