Created
September 3, 2014 15:29
-
-
Save bezelga/3e75ca9f9f776e6e127d 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
module Tod | |
module TasksRepository | |
class InMemory | |
def initialize | |
@tasks = {} | |
@id = 0 | |
end | |
def persist(task) | |
@id += 1 | |
task.id = @id | |
tasks[@id] = task | |
task | |
end | |
def count | |
tasks.length | |
end | |
private | |
attr_reader :tasks | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment