Class: DVLA::Herodotus::ProcWriter
- Inherits:
-
Object
- Object
- DVLA::Herodotus::ProcWriter
- Defined in:
- lib/dvla/herodotus/proc_writer.rb
Instance Attribute Summary collapse
-
#scenario ⇒ Object
Returns the value of attribute scenario.
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(proc) ⇒ ProcWriter
constructor
A new instance of ProcWriter.
- #write(*args) ⇒ Object
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
#scenario ⇒ Object
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
#close ⇒ Object
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 |