Class: Arachni::Browser::Javascript::TaintTracer::Sink::Base
- Defined in:
- lib/arachni/browser/javascript/taint_tracer/sink/base.rb
Overview
Direct Known Subclasses
Instance Attribute Summary collapse
-
#trace ⇒ Array<Frame>
Stacktrace.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
- #hash ⇒ Object
-
#initialize(options = {}) ⇒ Base
constructor
A new instance of Base.
- #to_h ⇒ Object
- #to_hash ⇒ Object
- #to_rpc_data ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Base
Returns a new instance of Base.
22 23 24 25 26 27 28 |
# File 'lib/arachni/browser/javascript/taint_tracer/sink/base.rb', line 22 def initialize( = {} ) .my_symbolize_keys(false).each do |k, v| send( "#{k}=", v ) end @trace ||= [] end |
Instance Attribute Details
Class Method Details
.from_rpc_data(data) ⇒ Object
52 53 54 55 |
# File 'lib/arachni/browser/javascript/taint_tracer/sink/base.rb', line 52 def self.from_rpc_data( data ) data['trace'] = data['trace'].map { |d| Frame.from_rpc_data( d ) } new data end |
Instance Method Details
#==(other) ⇒ Object
44 45 46 |
# File 'lib/arachni/browser/javascript/taint_tracer/sink/base.rb', line 44 def ==( other ) hash == other.hash end |
#hash ⇒ Object
40 41 42 |
# File 'lib/arachni/browser/javascript/taint_tracer/sink/base.rb', line 40 def hash to_h.hash end |
#to_h ⇒ Object
30 31 32 33 34 35 |
# File 'lib/arachni/browser/javascript/taint_tracer/sink/base.rb', line 30 def to_h instance_variables.inject({}) do |h, iv| h[iv.to_s.gsub('@', '').to_sym] = instance_variable_get( iv ) h end.merge( trace: trace.map(&:to_h)) end |
#to_hash ⇒ Object
36 37 38 |
# File 'lib/arachni/browser/javascript/taint_tracer/sink/base.rb', line 36 def to_hash to_h end |
#to_rpc_data ⇒ Object
48 49 50 |
# File 'lib/arachni/browser/javascript/taint_tracer/sink/base.rb', line 48 def to_rpc_data to_h.merge( trace: trace.map(&:to_rpc_data) ) end |