Class: Fantassh::Entries

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

Instance Method Summary collapse

Constructor Details

#initialize(entries_file: EntriesFile.new, excluded_entries_file: ExcludedEntriesFile.new) ⇒ Entries

Returns a new instance of Entries.



6
7
8
9
10
11
# File 'lib/fantassh/entries.rb', line 6

def initialize(entries_file: EntriesFile.new, excluded_entries_file: ExcludedEntriesFile.new)
  @entries_file = entries_file
  @excluded_entries_file = excluded_entries_file

  init_file_structure
end

Instance Method Details

#add(entries) ⇒ Object



13
14
15
# File 'lib/fantassh/entries.rb', line 13

def add(entries)
  @entries_file.add(entries)
end

#allObject



17
18
19
# File 'lib/fantassh/entries.rb', line 17

def all
  @entries_file.all - @excluded_entries_file.all
end

#exclude(entries) ⇒ Object



21
22
23
# File 'lib/fantassh/entries.rb', line 21

def exclude(entries)
  @excluded_entries_file.add(entries)
end

#init_file_structureObject



25
26
27
28
# File 'lib/fantassh/entries.rb', line 25

def init_file_structure
  @entries_file.init_file_structure
  @excluded_entries_file.init_file_structure
end