Class: Wicoris::Postman::Copier
- Inherits:
-
Object
- Object
- Wicoris::Postman::Copier
- Defined in:
- lib/wicoris/postman/copier.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Instance Method Summary collapse
-
#initialize(job, opts = {}) ⇒ Copier
constructor
A new instance of Copier.
-
#run ⇒ Object
Copy letter to destination.
Constructor Details
#initialize(job, opts = {}) ⇒ Copier
Returns a new instance of Copier.
9 10 11 12 13 |
# File 'lib/wicoris/postman/copier.rb', line 9 def initialize(job, opts = {}) @job = job @opts = opts @logger = opts[:logger] end |
Instance Attribute Details
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
7 8 9 |
# File 'lib/wicoris/postman/copier.rb', line 7 def logger @logger end |
Instance Method Details
#run ⇒ Object
Copy letter to destination.
16 17 18 19 20 21 22 |
# File 'lib/wicoris/postman/copier.rb', line 16 def run FileUtils.cp(source, destination, :noop => (@opts[:noop] == true)) logger.debug :message => 'Letter copied', :destination => destination, :letter => @job.letter, :job => @job end |