Just to expand on Ariejan's answer.
List - ordered. Similar to an Array in Ruby. Used for queues and keeping items ordered.
Set - an unordered list. It behaves similar to an Array in Ruby but is optimized for faster lookups.
Collection - used in conjunction with reference, it provides a simple way of representing associations.
In essence, collections and references are convenience methods for dealing with associations. So this:
class Post < Ohm::Model
attribute :title
attribute :body
collection :comments, Comment
end
class Comment < Ohm::Model
attribute :body
reference :post, Post
end
is a shortcut for the following:
class Post < Ohm::Model
attribute :title
attribute :body
def comments
Comment.find(:post_id => self.id)
end
end
class Comment < Ohm::Model
attribute :body
attribute :post_id
index :post_id
def post=(post)
self.post_id = post.id
end
def post
Post[post_id]
end
end
To answer you original question about the rationale for the design choice - collections and references were introduced to provide a simple api for representing associations.