I wonder if there's a solution to this issue, designing modules:
Amazon has a module with top-level name space AWS. It contains AWS::EC2 among others.
I am writing a module that provides more AWS functionality. I wanted to call it MY_ORG_NAME::AWS. It would have methods such as MY_ORG_NAME::AWS.instance_id.
I've hit a stumbling block, however:
require 'aws-sdk'
module MY_ORG_NAME
module AWS
def self.instance_id
ec2 = AWS::EC2.new # Error
...
end
end
end
The interpreter returns an error for that line above: *uninitialized constant MY_ORG_NAME::AWS::EC2*. I see what's going on. But I'm not sure there's anything I can do about it. It looks like the problem is that Amazon did not put their AWS module into a module name space such as AMAZON.
Is there some simple way to solve this, or some mistake I've made? My current best idea is to call my AWS module something other than AWS.