Class: Niman::FileHandler
- Inherits:
-
Object
- Object
- Niman::FileHandler
- Defined in:
- lib/niman/filehandler.rb
Instance Attribute Summary collapse
-
#shell ⇒ Object
readonly
Returns the value of attribute shell.
Instance Method Summary collapse
-
#initialize(shell) ⇒ FileHandler
constructor
A new instance of FileHandler.
- #run(files) ⇒ Object
Constructor Details
#initialize(shell) ⇒ FileHandler
Returns a new instance of FileHandler.
5 6 7 |
# File 'lib/niman/filehandler.rb', line 5 def initialize(shell) @shell = shell end |
Instance Attribute Details
#shell ⇒ Object (readonly)
Returns the value of attribute shell.
3 4 5 |
# File 'lib/niman/filehandler.rb', line 3 def shell @shell end |
Instance Method Details
#run(files) ⇒ Object
9 10 11 12 13 |
# File 'lib/niman/filehandler.rb', line 9 def run(files) Array(files).each do |file| shell.create_file(file.path, file.content) end end |