Class: Redis::TimeSeries::Filters::AnyValue

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



69
70
71
# File 'lib/redis/time_series/filters.rb', line 69

def label
  @label
end

#valuesObject

Returns the value of attribute values

Returns:

  • (Object)

    the current value of values



69
70
71
# File 'lib/redis/time_series/filters.rb', line 69

def values
  @values
end

Class Method Details

.parse(str) ⇒ Object



72
73
74
75
76
# File 'lib/redis/time_series/filters.rb', line 72

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

Instance Method Details

#to_hObject



78
79
80
# File 'lib/redis/time_series/filters.rb', line 78

def to_h
  { label => values }
end

#to_sObject



82
83
84
# File 'lib/redis/time_series/filters.rb', line 82

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