Class: DVLA::Herodotus::ProcWriter

Inherits:
Object
  • Object
show all
Defined in:
lib/dvla/herodotus/proc_writer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(proc) ⇒ ProcWriter

Returns a new instance of ProcWriter.



5
6
7
# File 'lib/dvla/herodotus/proc_writer.rb', line 5

def initialize(proc)
  @proc = proc
end

Instance Attribute Details

#scenarioObject

Returns the value of attribute scenario.



4
5
6
# File 'lib/dvla/herodotus/proc_writer.rb', line 4

def scenario
  @scenario
end

Instance Method Details

#closeObject



15
16
17
# File 'lib/dvla/herodotus/proc_writer.rb', line 15

def close
  # Nothing to close but we want to maintain consistency with other ways Herodotus can output
end

#write(*args) ⇒ Object



9
10
11
12
13
# File 'lib/dvla/herodotus/proc_writer.rb', line 9

def write(*args)
  output_file = File.open(self.instance_exec(&@proc), 'a')
  output_file.write(args[0])
  output_file.close
end