Class: Niman::FileHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/niman/filehandler.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#shellObject (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