Module: GitFeats::Completed
Constant Summary collapse
- PATH =
Dir.home + '/.git_feats/completed'
Instance Method Summary collapse
-
#add(feat) ⇒ Object
Add a feat to the list of completed feats.
- #data ⇒ Object
-
#exists?(feat) ⇒ Boolean
check of a user has already completed a feat.
-
#serialize ⇒ Object
write data to file.
-
#unserialize ⇒ Object
load data from file.
Instance Method Details
#add(feat) ⇒ Object
Add a feat to the list of completed feats
19 20 21 |
# File 'lib/git-feats/completed.rb', line 19 def add(feat) @completed << feat end |
#data ⇒ Object
28 29 30 |
# File 'lib/git-feats/completed.rb', line 28 def data @completed end |
#exists?(feat) ⇒ Boolean
check of a user has already completed a feat
24 25 26 |
# File 'lib/git-feats/completed.rb', line 24 def exists?(feat) @completed.include?(feat.to_s) end |
#serialize ⇒ Object
write data to file
14 15 16 |
# File 'lib/git-feats/completed.rb', line 14 def serialize Serializer.serialize(PATH, @completed) end |
#unserialize ⇒ Object
load data from file
9 10 11 |
# File 'lib/git-feats/completed.rb', line 9 def unserialize @completed = Serializer.unserialize(PATH) || [] end |