Class: Fantassh::History
- Inherits:
-
Object
- Object
- Fantassh::History
- Defined in:
- lib/fantassh/history.rb
Instance Method Summary collapse
- #add(entry) ⇒ Object
-
#initialize(file: HistoryFile.new) ⇒ History
constructor
A new instance of History.
- #last ⇒ Object
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 |
#last ⇒ Object
11 12 13 |
# File 'lib/fantassh/history.rb', line 11 def last @file.all.last end |