Class: Redis::TimeSeries::Filters::NotEqual

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



21
22
23
# File 'lib/redis/time_series/filters.rb', line 21

def label
  @label
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



21
22
23
# File 'lib/redis/time_series/filters.rb', line 21

def value
  @value
end

Class Method Details

.parse(str) ⇒ Object



24
25
26
# File 'lib/redis/time_series/filters.rb', line 24

def self.parse(str)
  new(*str.split('!='))
end

Instance Method Details

#to_hObject



28
29
30
# File 'lib/redis/time_series/filters.rb', line 28

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

#to_sObject



32
33
34
# File 'lib/redis/time_series/filters.rb', line 32

def to_s
  "#{label}!=#{value}"
end