Class: Amigrind::Blueprints::Provisioners::FileUpload

Inherits:
Amigrind::Blueprints::Provisioner show all
Defined in:
lib/amigrind/blueprints/provisioners/file_upload.rb

Instance Method Summary collapse

Methods inherited from Amigrind::Blueprints::Provisioner

#racker_name

Instance Method Details

#direction=(dir) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/amigrind/blueprints/provisioners/file_upload.rb', line 9

def direction=(dir)
  case dir
  when :download, :upload
    @direction_method = dir.to_s
  else
    raise "unrecognized 'direction': #{dir}"
  end
end

#to_racker_hashObject



18
19
20
21
22
23
24
25
# File 'lib/amigrind/blueprints/provisioners/file_upload.rb', line 18

def to_racker_hash
  {
    type: 'file',
    source: @source,
    destination: @destination,
    direction: @direction_method
  }.delete_if { |_, v| v.nil? }
end