Class: Refinuri::Filters::UnboundedRange

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

#delete, #initialize, #update

Constructor Details

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

Instance Method Details

#numeric_valueObject



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

def numeric_value
  @value.sub(/\.{2,3}/, '')
end

#to_dbObject



32
33
34
35
36
37
# File 'lib/refinuri/filters.rb', line 32

def to_db
  case @value
    when /^\.\./ then "#{@name} <= #{self.numeric_value}"
    when /\.\.$/ then "#{@name} >= #{self.numeric_value}"
  end
end

#to_sObject



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

def to_s
  Utilities.transcode_unbounded_range(@value)
end