Class: Refinuri::Filters::Array

Inherits:
Base::Filter show all
Defined in:
lib/refinuri/filters.rb

Instance Attribute Summary

Attributes inherited from Base::Filter

#name, #value

Instance Method Summary collapse

Methods inherited from Base::Filter

#initialize, #to_db

Constructor Details

This class inherits a constructor from Refinuri::Base::Filter

Instance Method Details

#delete(value) ⇒ Object



8
9
10
# File 'lib/refinuri/filters.rb', line 8

def delete(value)
  [value].flatten.each { |v| @value.delete(v) }
end

#to_sObject



12
13
14
# File 'lib/refinuri/filters.rb', line 12

def to_s
  value.join(',')
end

#update(value) ⇒ Object



4
5
6
# File 'lib/refinuri/filters.rb', line 4

def update(value)
  (@value << [value]).flatten!.uniq!
end