Class: DependencyGrapher::Logger
- Inherits:
-
Object
- Object
- DependencyGrapher::Logger
- Defined in:
- lib/dependency_grapher/logger.rb
Instance Attribute Summary collapse
-
#dependencies ⇒ Object
readonly
Returns the value of attribute dependencies.
Instance Method Summary collapse
- #disable ⇒ Object
- #dump(filename = "dependencies.yml") ⇒ Object
- #enable ⇒ Object
-
#initialize ⇒ Logger
constructor
A new instance of Logger.
Constructor Details
#initialize ⇒ Logger
Returns a new instance of Logger.
9 10 11 12 13 14 15 |
# File 'lib/dependency_grapher/logger.rb', line 9 def initialize @dependencies = {} @keys = Set.new @call_stack = [] @methods = {} @trace = get_trace_point end |
Instance Attribute Details
#dependencies ⇒ Object (readonly)
Returns the value of attribute dependencies.
8 9 10 |
# File 'lib/dependency_grapher/logger.rb', line 8 def dependencies @dependencies end |
Instance Method Details
#disable ⇒ Object
21 22 23 |
# File 'lib/dependency_grapher/logger.rb', line 21 def disable @trace.disable end |
#dump(filename = "dependencies.yml") ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/dependency_grapher/logger.rb', line 25 def dump(filename = "dependencies.yml") file = File.open(filename, "w") @keys.each do |key| file.puts @dependencies[key].serialize file.puts end end |
#enable ⇒ Object
17 18 19 |
# File 'lib/dependency_grapher/logger.rb', line 17 def enable @trace.enable end |