Class: HaveAPI::Fs::Components::DeleteActionDir

Inherits:
ActionDir show all
Defined in:
lib/haveapi/fs/components/delete_action_dir.rb

Constant Summary

Constants included from Help

Help::SEARCH_PATH

Instance Attribute Summary

Attributes inherited from ActionDir

#action, #resource

Attributes inherited from HaveAPI::Fs::Component

#atime, #context, #ctime, #mtime

Instance Method Summary collapse

Methods inherited from ActionDir

#contents, #initialize, #setup, #title

Methods inherited from Directory

#contents, #directory?

Methods included from Help

find!, included

Methods inherited from HaveAPI::Fs::Component

#abspath, #bound=, #bound?, children_reader, component, #contents, #directory?, #executable?, #file?, #find, inherited, #initialize, #invalid?, #invalidate, #parent, #path, #readable?, #reset, #setup, #times, #title, #unsaved?, #use, #writable?

Constructor Details

This class inherits a constructor from HaveAPI::Fs::Components::ActionDir

Instance Method Details

#execObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/haveapi/fs/components/delete_action_dir.rb', line 5

def exec
  ret = super
  
  if ret.is_a?(HaveAPI::Client::Response) && ret.ok?
    if @resource.is_a?(HaveAPI::Client::ResourceInstance)
      id = @resource.id

    else
      id = @resource.prepared_args.last
    end

    context[:resource_dir].delete(id)
  end

  ret
end