Class: Alert
- Inherits:
-
Object
- Object
- Alert
- Defined in:
- lib/sdee.rb
Instance Attribute Summary collapse
-
#alert_time ⇒ Object
Returns the value of attribute alert_time.
-
#attacker ⇒ Object
Returns the value of attribute attacker.
-
#attacker_locality ⇒ Object
Returns the value of attribute attacker_locality.
-
#attacker_port ⇒ Object
Returns the value of attribute attacker_port.
-
#event_id ⇒ Object
Returns the value of attribute event_id.
-
#originator ⇒ Object
Returns the value of attribute originator.
-
#protocol ⇒ Object
Returns the value of attribute protocol.
-
#risk_rating ⇒ Object
Returns the value of attribute risk_rating.
-
#severity ⇒ Object
Returns the value of attribute severity.
-
#sig_detail ⇒ Object
Returns the value of attribute sig_detail.
-
#sig_id ⇒ Object
Returns the value of attribute sig_id.
-
#sig_version ⇒ Object
Returns the value of attribute sig_version.
-
#subsig_id ⇒ Object
Returns the value of attribute subsig_id.
-
#target_locality ⇒ Object
Returns the value of attribute target_locality.
-
#target_port ⇒ Object
Returns the value of attribute target_port.
-
#targets ⇒ Object
Returns the value of attribute targets.
-
#threat_rating ⇒ Object
Returns the value of attribute threat_rating.
Instance Method Summary collapse
-
#initialize(xml_doc) ⇒ Alert
constructor
A new instance of Alert.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(xml_doc) ⇒ Alert
Returns a new instance of Alert.
13 14 15 16 17 18 19 |
# File 'lib/sdee.rb', line 13 def initialize(xml_doc) @doc = xml_doc build_alert build_sig build_participants end |
Instance Attribute Details
#alert_time ⇒ Object
Returns the value of attribute alert_time.
8 9 10 |
# File 'lib/sdee.rb', line 8 def alert_time @alert_time end |
#attacker ⇒ Object
Returns the value of attribute attacker.
8 9 10 |
# File 'lib/sdee.rb', line 8 def attacker @attacker end |
#attacker_locality ⇒ Object
Returns the value of attribute attacker_locality.
8 9 10 |
# File 'lib/sdee.rb', line 8 def attacker_locality @attacker_locality end |
#attacker_port ⇒ Object
Returns the value of attribute attacker_port.
8 9 10 |
# File 'lib/sdee.rb', line 8 def attacker_port @attacker_port end |
#event_id ⇒ Object
Returns the value of attribute event_id.
8 9 10 |
# File 'lib/sdee.rb', line 8 def event_id @event_id end |
#originator ⇒ Object
Returns the value of attribute originator.
8 9 10 |
# File 'lib/sdee.rb', line 8 def originator @originator end |
#protocol ⇒ Object
Returns the value of attribute protocol.
8 9 10 |
# File 'lib/sdee.rb', line 8 def protocol @protocol end |
#risk_rating ⇒ Object
Returns the value of attribute risk_rating.
8 9 10 |
# File 'lib/sdee.rb', line 8 def @risk_rating end |
#severity ⇒ Object
Returns the value of attribute severity.
8 9 10 |
# File 'lib/sdee.rb', line 8 def severity @severity end |
#sig_detail ⇒ Object
Returns the value of attribute sig_detail.
8 9 10 |
# File 'lib/sdee.rb', line 8 def sig_detail @sig_detail end |
#sig_id ⇒ Object
Returns the value of attribute sig_id.
8 9 10 |
# File 'lib/sdee.rb', line 8 def sig_id @sig_id end |
#sig_version ⇒ Object
Returns the value of attribute sig_version.
8 9 10 |
# File 'lib/sdee.rb', line 8 def sig_version @sig_version end |
#subsig_id ⇒ Object
Returns the value of attribute subsig_id.
8 9 10 |
# File 'lib/sdee.rb', line 8 def subsig_id @subsig_id end |
#target_locality ⇒ Object
Returns the value of attribute target_locality.
8 9 10 |
# File 'lib/sdee.rb', line 8 def target_locality @target_locality end |
#target_port ⇒ Object
Returns the value of attribute target_port.
8 9 10 |
# File 'lib/sdee.rb', line 8 def target_port @target_port end |
#targets ⇒ Object
Returns the value of attribute targets.
8 9 10 |
# File 'lib/sdee.rb', line 8 def targets @targets end |
#threat_rating ⇒ Object
Returns the value of attribute threat_rating.
8 9 10 |
# File 'lib/sdee.rb', line 8 def @threat_rating end |
Instance Method Details
#to_hash ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/sdee.rb', line 21 def to_hash vars = {} instance_variables.reject {|var| var == :@doc }.each do |var| vars[var.to_s[1..-1]] = instance_variable_get(var) end vars end |
#to_json ⇒ Object
31 32 33 |
# File 'lib/sdee.rb', line 31 def to_json to_hash.to_json end |