Class: Rhcf::Timeseries::Filter
- Inherits:
-
Object
- Object
- Rhcf::Timeseries::Filter
- Defined in:
- lib/rhcf/timeseries/manager.rb
Instance Attribute Summary collapse
-
#regex ⇒ Object
readonly
Returns the value of attribute regex.
Instance Method Summary collapse
-
#initialize(keys, values) ⇒ Filter
constructor
A new instance of Filter.
- #match?(value) ⇒ Boolean
- #to_lua_pattern ⇒ Object
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
#regex ⇒ Object (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
23 24 25 |
# File 'lib/rhcf/timeseries/manager.rb', line 23 def match?(value) value =~ regex end |
#to_lua_pattern ⇒ Object
27 28 29 |
# File 'lib/rhcf/timeseries/manager.rb', line 27 def to_lua_pattern @lua_pattern ||= @keys.map{|key| @values[key]|| '.*'}.join('/') end |