FixedArray Class In Ruby
I'm not sure that delegating to a normal array is not the best solution. Normally when I create classes like this the intent is to provide a more rigid interface over an array and delegation would be the best solution. What you have will certainly work but is going to be extremely in-efficient speed wise since those get/set/defined methods are quite slow. i.e. This is great as an exercise but I would never write code like this in a real world app.

Some changes I would make:


The set method does no checking so it is currently possible to add items to the array
Instead of instance_variable_defined? I would use (0..size).include?(index)
I would extract the index checking into a method and use it in both set/get:

def check_index!(index)
  raise OutOfBoundsError unless (0..size).include?(index)
end

I would add [] and []= aliases for get and set


Also most style guides recommend against using self. redundantly to prefix method names.