Class: Fantassh::History

Inherits:
Object
  • Object
show all
Defined in:
lib/fantassh/history.rb

Instance Method Summary collapse

Constructor Details

#initialize(file: HistoryFile.new) ⇒ History

Returns a new instance of History.



5
6
7
8
9
# File 'lib/fantassh/history.rb', line 5

def initialize(file: HistoryFile.new)
  @file = file

  @file.init_file_structure
end

Instance Method Details

#add(entry) ⇒ Object



15
16
17
# File 'lib/fantassh/history.rb', line 15

def add(entry)
  @file.add([entry])
end

#lastObject



11
12
13
# File 'lib/fantassh/history.rb', line 11

def last
  @file.all.last
end