mnbi / textrepo

A repository to store a note text with a timestamp
MIT License
0 stars 0 forks source link

Add new method, Repository#exist? #19

Closed mnbi closed 4 years ago

mnbi commented 4 years ago

Like FileTest.exist? in Ruby, the method returns true when a note exists with the given timestamp in the repository. Otherwise, returns false. If the argument is invalid as a timestamp string, it raises an error.

mnbi commented 4 years ago

The method would be as:

Repository#exist?(timestamp) -> true or false

The only argument timestamp must be an instance of Timestamp class. The user of this method could convert a string into a Timestamp object with Timestamp.parse_s method.