Class: Redis::TimeSeries::Filters::NoValues

Inherits:
Struct
  • Object
show all
Defined in:
lib/redis/time_series/filters.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#labelObject

Returns the value of attribute label

Returns:

  • (Object)

    the current value of label



87
88
89
# File 'lib/redis/time_series/filters.rb', line 87

def label
  @label
end

#valuesObject

Returns the value of attribute values

Returns:

  • (Object)

    the current value of values



87
88
89
# File 'lib/redis/time_series/filters.rb', line 87

def values
  @values
end

Class Method Details

.parse(str) ⇒ Object



90
91
92
93
94
# File 'lib/redis/time_series/filters.rb', line 90

def self.parse(str)
  label, values = str.split('!=')
  values = values.tr('()', '').split(',')
  new(label, values)
end

Instance Method Details

#to_hObject



96
97
98
# File 'lib/redis/time_series/filters.rb', line 96

def to_h
  { label => { not: values } }
end

#to_sObject



100
101
102
# File 'lib/redis/time_series/filters.rb', line 100

def to_s
  "#{label}!=(#{values.map(&:to_s).join(',')})"
end