Module: Thor::Hooks::InstanceMethods

Defined in:
lib/web_crawler/cli/thor_hooks.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



10
11
12
# File 'lib/web_crawler/cli/thor_hooks.rb', line 10

def response
  @response
end

Instance Method Details

#after_hooksObject



16
17
18
# File 'lib/web_crawler/cli/thor_hooks.rb', line 16

def after_hooks
  self.class.after_hooks
end

#before_hooksObject



12
13
14
# File 'lib/web_crawler/cli/thor_hooks.rb', line 12

def before_hooks
  self.class.before_hooks
end

#invoke_task(task, *args) ⇒ Object

Invoke the given task if the given args.



21
22
23
24
25
26
27
# File 'lib/web_crawler/cli/thor_hooks.rb', line 21

def invoke_task(task, *args) #:nodoc:
  self.class.run_hooks :before, self, task
  @task_result = super(task, *args)
  @task_result.tap do
    self.class.run_hooks :after, self, task
  end
end