-
-
Save universal/2cd1c2077b52c8d28ebe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class JTask | |
# JTask.find() | |
# Retrieves records from the database file. | |
# -------------------------------------------------------------------------------- | |
# Eg: JTask.find("test.json", 1) || JTask.find("test.json", first: 10) | |
# #=> <JTask id=x, ...> | |
# -------------------------------------------------------------------------------- | |
# See wiki guide for more usage examples... | |
# https://github.com/adammcarthur/jtask/wiki/find | |
def self.find(file, id_or_options) | |
do_something_with_the_file | |
case id_or_options | |
when Integer | |
self.find_by_id(file, id_or_options) | |
when Array | |
self.find_many(file, id_or_options) | |
when Hash | |
when :all | |
self.find_all... | |
end | |
def self.find_by_id(..) | |
... | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment