Here is the exact code that you are using under the hood:
https://github.com/marcel/aws-s3/blob/master/lib/aws/s3/bucket.rb
As you can see, there are nested modules/classes:
module AWS
module S3
class Bucket < Base
end
end
end
So:
- 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.