Class: Sapphire::Plugins::VerbosePlugin

Inherits:
Plugin show all
Defined in:
lib/sapphire/Plugins/Debugging/VerboseObserver.rb

Instance Attribute Summary

Attributes inherited from Plugin

#method, #object

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Plugin

observe, #observes

Constructor Details

#initializeVerbosePlugin

Returns a new instance of VerbosePlugin.



6
7
8
9
10
11
# File 'lib/sapphire/Plugins/Debugging/VerboseObserver.rb', line 6

def initialize

  observes :class => :all,
           :method => :all

end

Class Method Details

.IsObserverObject



29
30
31
# File 'lib/sapphire/Plugins/Debugging/VerboseObserver.rb', line 29

def self.IsObserver()
  true
end

Instance Method Details

#After(instance, method, args) ⇒ Object



17
18
19
# File 'lib/sapphire/Plugins/Debugging/VerboseObserver.rb', line 17

def After(instance, method, args)
  puts "after" if ENV["verbose"] == "true"
end

#Before(instance, method, args) ⇒ Object



13
14
15
# File 'lib/sapphire/Plugins/Debugging/VerboseObserver.rb', line 13

def Before(instance, method, args)
  puts "before #{method} on #{instance}" if ENV["verbose"] == "true"
end

#OnFailure(instance, method, exception, args) ⇒ Object



25
26
27
# File 'lib/sapphire/Plugins/Debugging/VerboseObserver.rb', line 25

def OnFailure(instance, method, exception, args)
  puts "failure" if ENV["verbose"] == "true"
end

#OnSuccess(instance, method, args) ⇒ Object



21
22
23
# File 'lib/sapphire/Plugins/Debugging/VerboseObserver.rb', line 21

def OnSuccess(instance, method, args)
  puts "success" if ENV["verbose"] == "true"
end