Module: GitFeats::Completed

Extended by:
Completed
Included in:
Completed
Defined in:
lib/git-feats/completed.rb

Constant Summary collapse

PATH =
Dir.home + '/.git_feats/completed'

Instance Method Summary collapse

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

#dataObject



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

Returns:

  • (Boolean)


24
25
26
# File 'lib/git-feats/completed.rb', line 24

def exists?(feat)
  @completed.include?(feat.to_s)
end

#serializeObject

write data to file



14
15
16
# File 'lib/git-feats/completed.rb', line 14

def serialize
  Serializer.serialize(PATH, @completed)
end

#unserializeObject

load data from file



9
10
11
# File 'lib/git-feats/completed.rb', line 9

def unserialize
  @completed = Serializer.unserialize(PATH) || []
end