Class: SourceRoute::Proxy
- Includes:
- Singleton
- Defined in:
- lib/source_route/proxy.rb
Overview
todo Rename it to Proxy
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#result_builder ⇒ Object
Returns the value of attribute result_builder.
-
#tp ⇒ Object
Returns the value of attribute tp.
Instance Method Summary collapse
-
#initialize ⇒ Proxy
constructor
A new instance of Proxy.
- #reset ⇒ Object
- #tp_result_chain ⇒ Object
- #trace ⇒ Object
Constructor Details
#initialize ⇒ Proxy
Returns a new instance of Proxy.
8 9 10 |
# File 'lib/source_route/proxy.rb', line 8 def initialize reset end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
6 7 8 |
# File 'lib/source_route/proxy.rb', line 6 def config @config end |
#result_builder ⇒ Object
Returns the value of attribute result_builder.
6 7 8 |
# File 'lib/source_route/proxy.rb', line 6 def result_builder @result_builder end |
#tp ⇒ Object
Returns the value of attribute tp.
6 7 8 |
# File 'lib/source_route/proxy.rb', line 6 def tp @tp end |
Instance Method Details
#reset ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/source_route/proxy.rb', line 12 def reset @tp.disable if defined? @tp @config = Config.new # only init once, so its @collected_data seems not useful @result_builder = GenerateResult.new(self) GenerateResult.clear_wanted_attributes self end |
#tp_result_chain ⇒ Object
31 32 33 |
# File 'lib/source_route/proxy.rb', line 31 def tp_result_chain result_builder.tp_result_chain end |
#trace ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/source_route/proxy.rb', line 21 def trace tp_filter = TpFilter.new(config) track = TracePoint.new(*config.event) do |tp| next if tp_filter.block_it?(tp) @result_builder.output(tp) end track.enable self.tp = track end |