Class: Terminator

Inherits:
Object
  • Object
show all
Defined in:
lib/dunmanifestin/terminator.rb

Defined Under Namespace

Modules: Shell

Instance Method Summary collapse

Constructor Details

#initialize(list_loader: ListLoader, shell: Shell) ⇒ Terminator

Returns a new instance of Terminator.



6
7
8
9
# File 'lib/dunmanifestin/terminator.rb', line 6

def initialize(list_loader: ListLoader, shell: Shell)
  @list_loader = list_loader
  @shell = shell
end

Instance Method Details

#address(demands) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/dunmanifestin/terminator.rb', line 11

def address demands
  phrase_string = phrasing(demands[:phrase], demands[:file])
  root_phrase_class = Class.new(Phrase) { list phrase_string, !!demands[:file] }
  list_loader.load demands[:genre]
  print interactive_banner if demands[:interactive]

  construction_loop(
    root_phrase_class,
    (demands[:count] || 1),
    demands[:chomp],
    demands[:copy],
    demands[:interactive]
  )
end