Ruby Callback System
Why not use a hashmap as the main DS? That way, you optimize for when name and event are defined, and suffer only a constant penalty and degrades to linear for other cases. (In your solution the cost is always linear). (As below)

class Callbacks
  def initialize
    @callbacks = {}
  end

  def add(name, event, &amp;block)
    key = {:name =&gt; name, :event =&gt; event}
    @callbacks[key] = block if block_given?


shouldn't we throw an exception if block is not given?

  end

  def get(o={})


We can use values_at to extract multiple values from a hash.

    name,event = o.values_at(:name,:event)


We don't need to check if name and event separately because equality checking does it for us.

    return @callbacks[o] if name and event
    @callbacks.each do |k,v|
      return v if k[:name] == name or k[:event] == event
    end
    nil
  end
end


And shouldn't you provide a way to unregister from callback?