Class: Rhcf::Timeseries::Filter

Inherits:
Object
  • Object
show all
Defined in:
lib/rhcf/timeseries/manager.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(keys, values) ⇒ Filter

Returns a new instance of Filter.



14
15
16
17
# File 'lib/rhcf/timeseries/manager.rb', line 14

def initialize(keys, values)
  @keys   = keys
  @values = values
end

Instance Attribute Details

#regexObject (readonly)

Returns the value of attribute regex.



13
14
15
# File 'lib/rhcf/timeseries/manager.rb', line 13

def regex
  @regex
end

Instance Method Details

#match?(value) ⇒ Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/rhcf/timeseries/manager.rb', line 23

def match?(value)
  value =~ regex
end

#to_lua_patternObject



27
28
29
# File 'lib/rhcf/timeseries/manager.rb', line 27

def to_lua_pattern
  @lua_pattern ||= @keys.map{|key| @values[key]|| '.*'}.join('/')
end