Class: Threshold::EventFilter

Inherits:
Object
  • Object
show all
Includes:
Comparable, Standalone
Defined in:
lib/threshold/event_filter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Standalone

#<=>, #comment?

Constructor Details

#initialize(line = "") ⇒ EventFilter

Returns a new instance of EventFilter.



82
83
84
# File 'lib/threshold/event_filter.rb', line 82

def initialize(line="")
  transform(line) unless line.empty?
end

Instance Attribute Details

#commentObject

Returns the value of attribute comment.



76
77
78
# File 'lib/threshold/event_filter.rb', line 76

def comment
  @comment
end

#countObject

Returns the value of attribute count.



76
77
78
# File 'lib/threshold/event_filter.rb', line 76

def count
  @count
end

#gidObject

Returns the value of attribute gid.



76
77
78
# File 'lib/threshold/event_filter.rb', line 76

def gid
  @gid
end

#secondsObject

Returns the value of attribute seconds.



76
77
78
# File 'lib/threshold/event_filter.rb', line 76

def seconds
  @seconds
end

#sidObject

Returns the value of attribute sid.



76
77
78
# File 'lib/threshold/event_filter.rb', line 76

def sid
  @sid
end

#track_byObject

Returns the value of attribute track_by.



76
77
78
# File 'lib/threshold/event_filter.rb', line 76

def track_by
  @track_by
end

#typeObject

Returns the value of attribute type.



76
77
78
# File 'lib/threshold/event_filter.rb', line 76

def type
  @type
end

Instance Method Details

#to_s(skip = false) ⇒ Object



86
87
88
89
90
91
92
93
94
95
96
# File 'lib/threshold/event_filter.rb', line 86

def to_s(skip = false)
   if self.valid? 
     if comment?(skip)
   		"event_filter gen_id #{@gid}, sig_id #{@sid}, type #{@type}, track by_#{@track_by}, count #{@count}, seconds #{@seconds} #{@comment}"
     else
       "event_filter gen_id #{@gid}, sig_id #{@sid}, type #{@type}, track by_#{@track_by}, count #{@count}, seconds #{@seconds}" 
     end
   else
     raise InvalidEventFilterObject, 'Event Filter did not validate'
   end
end