From: Reginald Tan Date: 2011-11-01T11:14:55+09:00 Subject: how to make interface explicit with Hash stores? I have a class that uses hash as its internal store. What's a good way to communicate the interface of my methods. It seems like the user would only know how to use it if there's a comment or a test case. This is the interface that I want them to use: book = Book.new book.add_content(1 => some_text) book.add_content(2 => some_text) This is the class that I have: class Book def initialize() @hash = {} end def add_contents(hash) @hash.merge! hash end def contents @hash end end -- Posted via http://www.ruby-forum.com/.