Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/delivery/query_parameters/filters.rb
Overview
Extend String class to allow semantic typing of filters
Instance Method Summary collapse
-
#all(*args) ⇒ Object
Represents a filter that matches a content item if the specified content element or system attribute has a value that contains all the specified values.
-
#any(*args) ⇒ Object
Represents a filter that matches a content item if the specified content element or system attribute has a value that contains any the specified values.
-
#contains(*args) ⇒ Object
Represents a filter that matches a content item if the specified content element or system attribute has a value that contains the specified value.
-
#empty ⇒ Object
Represents a filter that matches a content item if the specified content element or system attribute does not have any value.
-
#eq(*args) ⇒ Object
Represents a filter that matches a content item if the specified content element or system attribute has the specified value.
-
#gt(*args) ⇒ Object
Represents a filter that matches a content item if the specified content element or system attribute has a value that is greater than the specified value.
-
#gt_or_eq(*args) ⇒ Object
Represents a filter that matches a content item if the specified content element or system attribute has a value that is greater than or equal to the specified value.
-
#in(*args) ⇒ Object
Represents a filter that matches a content item if the specified content element or system attribute has a value that matches a value in the specified list.
-
#lt(*args) ⇒ Object
Represents a filter that matches a content item if the specified content element or system attribute has a value that is less than the specified value.
-
#lt_or_eq(*args) ⇒ Object
Represents a filter that matches a content item if the specified content element or system attribute has a value that is less than or equal to the specified value.
-
#not_empty ⇒ Object
Represents a filter that matches a content item if the specified content element or system attribute has any value.
-
#not_eq(*args) ⇒ Object
Represents a filter that matches a content item if the specified content element or system attribute does not have the specified value.
-
#not_in(*args) ⇒ Object
Represents a filter that matches a content item if the specified content element or system attribute does not have the specified value.
-
#range(*args) ⇒ Object
Represents a filter that matches a content item if the specified content element or system attribute has a value that falls within the specified range of values (both inclusive).
Instance Method Details
#all(*args) ⇒ Object
Represents a filter that matches a content item if the specified content element or system attribute has a value that contains all the specified values. This filter is applicable to array values only, such as sitemap location or value of Linked Items, Taxonomy and Multiple choice content elements.
-
Args:
-
Object
One or more objects representing the values that must appear in the field
-
-
Returns:
-
Kentico::Kontent::Delivery::QueryParameters::Filter
-
38 39 40 |
# File 'lib/delivery/query_parameters/filters.rb', line 38 def all(*args) Kentico::Kontent::Delivery::QueryParameters::Filter.new(self, '[all]', *args) end |
#any(*args) ⇒ Object
Represents a filter that matches a content item if the specified content element or system attribute has a value that contains any the specified values. This filter is applicable to array values only, such as sitemap location or value of Linked Items, Taxonomy and Multiple choice content elements.
-
Args:
-
Object
One or more objects representing the values that may appear in the field
-
-
Returns:
-
Kentico::Kontent::Delivery::QueryParameters::Filter
-
52 53 54 |
# File 'lib/delivery/query_parameters/filters.rb', line 52 def any(*args) Kentico::Kontent::Delivery::QueryParameters::Filter.new(self, '[any]', *args) end |
#contains(*args) ⇒ Object
Represents a filter that matches a content item if the specified content element or system attribute has a value that contains the specified value. This filter is applicable to array values only, such as sitemap location or value of Linked Items, Taxonomy and Multiple choice content elements.
-
Args:
-
Object
An object representing the value that must appear in the field
-
-
Returns:
-
Kentico::Kontent::Delivery::QueryParameters::Filter
-
66 67 68 |
# File 'lib/delivery/query_parameters/filters.rb', line 66 def contains(*args) Kentico::Kontent::Delivery::QueryParameters::Filter.new(self, '[contains]', *args) end |
#empty ⇒ Object
Represents a filter that matches a content item if the specified content element or system attribute does not have any value.
-
Returns:
-
Kentico::Kontent::Delivery::QueryParameters::Filter
-
99 100 101 |
# File 'lib/delivery/query_parameters/filters.rb', line 99 def empty Kentico::Kontent::Delivery::QueryParameters::Filter.new(self, '[empty]', nil, false) end |
#eq(*args) ⇒ Object
Represents a filter that matches a content item if the specified content element or system attribute has the specified value.
-
Args:
-
Object
An object representing the value that must equal the value in the field
-
-
Returns:
-
Kentico::Kontent::Delivery::QueryParameters::Filter
-
78 79 80 |
# File 'lib/delivery/query_parameters/filters.rb', line 78 def eq(*args) Kentico::Kontent::Delivery::QueryParameters::Filter.new(self, '', *args) end |
#gt(*args) ⇒ Object
Represents a filter that matches a content item if the specified content element or system attribute has a value that is greater than the specified value.
-
Args:
-
Object
An object representing the lowest possible value of the field, non-inclusive
-
-
Returns:
-
Kentico::Kontent::Delivery::QueryParameters::Filter
-
133 134 135 |
# File 'lib/delivery/query_parameters/filters.rb', line 133 def gt(*args) Kentico::Kontent::Delivery::QueryParameters::Filter.new(self, '[gt]', *args) end |
#gt_or_eq(*args) ⇒ Object
Represents a filter that matches a content item if the specified content element or system attribute has a value that is greater than or equal to the specified value.
-
Args:
-
Object
An object representing the lowest possible value of the field
-
-
Returns:
-
Kentico::Kontent::Delivery::QueryParameters::Filter
-
146 147 148 |
# File 'lib/delivery/query_parameters/filters.rb', line 146 def gt_or_eq(*args) Kentico::Kontent::Delivery::QueryParameters::Filter.new(self, '[gte]', *args) end |
#in(*args) ⇒ Object
Represents a filter that matches a content item if the specified content element or system attribute has a value that matches a value in the specified list.
-
Args:
-
Object
One or more objects representing the required values of the field
-
-
Returns:
-
Kentico::Kontent::Delivery::QueryParameters::Filter
-
159 160 161 |
# File 'lib/delivery/query_parameters/filters.rb', line 159 def in(*args) Kentico::Kontent::Delivery::QueryParameters::Filter.new(self, '[in]', *args) end |
#lt(*args) ⇒ Object
Represents a filter that matches a content item if the specified content element or system attribute has a value that is less than the specified value.
-
Args:
-
Object
An object representing the highest possible value of the field, non-inclusive
-
-
Returns:
-
Kentico::Kontent::Delivery::QueryParameters::Filter
-
172 173 174 |
# File 'lib/delivery/query_parameters/filters.rb', line 172 def lt(*args) Kentico::Kontent::Delivery::QueryParameters::Filter.new(self, '[lt]', *args) end |
#lt_or_eq(*args) ⇒ Object
Represents a filter that matches a content item if the specified content element or system attribute has a value that is less than or equal to the specified value.
-
Args:
-
Object
An object representing the highest possible value of the field
-
-
Returns:
-
Kentico::Kontent::Delivery::QueryParameters::Filter
-
185 186 187 |
# File 'lib/delivery/query_parameters/filters.rb', line 185 def lt_or_eq(*args) Kentico::Kontent::Delivery::QueryParameters::Filter.new(self, '[lte]', *args) end |
#not_empty ⇒ Object
Represents a filter that matches a content item if the specified content element or system attribute has any value.
-
Returns:
-
Kentico::Kontent::Delivery::QueryParameters::Filter
-
108 109 110 |
# File 'lib/delivery/query_parameters/filters.rb', line 108 def not_empty Kentico::Kontent::Delivery::QueryParameters::Filter.new(self, '[nempty]', nil, false) end |
#not_eq(*args) ⇒ Object
Represents a filter that matches a content item if the specified content element or system attribute does not have the specified value.
-
Args:
-
Object
An object representing the value that cannot exist in the element
-
-
Returns:
-
Kentico::Kontent::Delivery::QueryParameters::Filter
-
90 91 92 |
# File 'lib/delivery/query_parameters/filters.rb', line 90 def not_eq(*args) Kentico::Kontent::Delivery::QueryParameters::Filter.new(self, '[neq]', *args) end |
#not_in(*args) ⇒ Object
Represents a filter that matches a content item if the specified content element or system attribute does not have the specified value.
-
Args:
-
Object
An object representing the value that cannot exist in the element
-
-
Returns:
-
Kentico::Kontent::Delivery::QueryParameters::Filter
-
120 121 122 |
# File 'lib/delivery/query_parameters/filters.rb', line 120 def not_in(*args) Kentico::Kontent::Delivery::QueryParameters::Filter.new(self, '[nin]', *args) end |
#range(*args) ⇒ Object
Represents a filter that matches a content item if the specified content element or system attribute has a value that falls within the specified range of values (both inclusive).
-
Args:
-
Object
An object representing the lowest and highest possible values of the field
-
-
Returns:
-
Kentico::Kontent::Delivery::QueryParameters::Filter
-
198 199 200 |
# File 'lib/delivery/query_parameters/filters.rb', line 198 def range(*args) Kentico::Kontent::Delivery::QueryParameters::Filter.new(self, '[range]', *args) end |