Class: SDEE::Alert
- Inherits:
-
Object
- Object
- SDEE::Alert
- Defined in:
- lib/sdee/alert.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.
10 11 12 13 14 15 16 |
# File 'lib/sdee/alert.rb', line 10 def initialize(xml_doc) @alert_xml = xml_doc build_alert build_sig build_participants end |
Instance Attribute Details
#alert_time ⇒ Object
Returns the value of attribute alert_time.
5 6 7 |
# File 'lib/sdee/alert.rb', line 5 def alert_time @alert_time end |
#attacker ⇒ Object
Returns the value of attribute attacker.
5 6 7 |
# File 'lib/sdee/alert.rb', line 5 def attacker @attacker end |
#attacker_locality ⇒ Object
Returns the value of attribute attacker_locality.
5 6 7 |
# File 'lib/sdee/alert.rb', line 5 def attacker_locality @attacker_locality end |
#attacker_port ⇒ Object
Returns the value of attribute attacker_port.
5 6 7 |
# File 'lib/sdee/alert.rb', line 5 def attacker_port @attacker_port end |
#event_id ⇒ Object
Returns the value of attribute event_id.
5 6 7 |
# File 'lib/sdee/alert.rb', line 5 def event_id @event_id end |
#originator ⇒ Object
Returns the value of attribute originator.
5 6 7 |
# File 'lib/sdee/alert.rb', line 5 def originator @originator end |
#protocol ⇒ Object
Returns the value of attribute protocol.
5 6 7 |
# File 'lib/sdee/alert.rb', line 5 def protocol @protocol end |
#risk_rating ⇒ Object
Returns the value of attribute risk_rating.
5 6 7 |
# File 'lib/sdee/alert.rb', line 5 def end |
#severity ⇒ Object
Returns the value of attribute severity.
5 6 7 |
# File 'lib/sdee/alert.rb', line 5 def severity @severity end |
#sig_detail ⇒ Object
Returns the value of attribute sig_detail.
5 6 7 |
# File 'lib/sdee/alert.rb', line 5 def sig_detail @sig_detail end |
#sig_id ⇒ Object
Returns the value of attribute sig_id.
5 6 7 |
# File 'lib/sdee/alert.rb', line 5 def sig_id @sig_id end |
#sig_version ⇒ Object
Returns the value of attribute sig_version.
5 6 7 |
# File 'lib/sdee/alert.rb', line 5 def sig_version @sig_version end |
#subsig_id ⇒ Object
Returns the value of attribute subsig_id.
5 6 7 |
# File 'lib/sdee/alert.rb', line 5 def subsig_id @subsig_id end |
#target_locality ⇒ Object
Returns the value of attribute target_locality.
5 6 7 |
# File 'lib/sdee/alert.rb', line 5 def target_locality @target_locality end |
#target_port ⇒ Object
Returns the value of attribute target_port.
5 6 7 |
# File 'lib/sdee/alert.rb', line 5 def target_port @target_port end |
#targets ⇒ Object
Returns the value of attribute targets.
5 6 7 |
# File 'lib/sdee/alert.rb', line 5 def targets @targets end |
#threat_rating ⇒ Object
Returns the value of attribute threat_rating.
5 6 7 |
# File 'lib/sdee/alert.rb', line 5 def end |
Instance Method Details
#to_hash ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/sdee/alert.rb', line 18 def to_hash vars = {} instance_variables.reject {|var| var == :@alert_xml }.each do |var| vars[var.to_s[1..-1]] = instance_variable_get(var) end vars end |
#to_json ⇒ Object
28 29 30 |
# File 'lib/sdee/alert.rb', line 28 def to_json to_hash.to_json end |