Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/delivery/query_parameters/filters.rb

Overview

Extend String class to allow semantic typing of filters

Instance Method Summary collapse

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



37
38
39
# File 'lib/delivery/query_parameters/filters.rb', line 37

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



51
52
53
# File 'lib/delivery/query_parameters/filters.rb', line 51

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



65
66
67
# File 'lib/delivery/query_parameters/filters.rb', line 65

def contains(*args)
  Kentico::Kontent::Delivery::QueryParameters::Filter.new(self, '[contains]', *args)
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



77
78
79
# File 'lib/delivery/query_parameters/filters.rb', line 77

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



90
91
92
# File 'lib/delivery/query_parameters/filters.rb', line 90

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



103
104
105
# File 'lib/delivery/query_parameters/filters.rb', line 103

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



116
117
118
# File 'lib/delivery/query_parameters/filters.rb', line 116

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



129
130
131
# File 'lib/delivery/query_parameters/filters.rb', line 129

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



142
143
144
# File 'lib/delivery/query_parameters/filters.rb', line 142

def lt_or_eq(*args)
  Kentico::Kontent::Delivery::QueryParameters::Filter.new(self, '[lte]', *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



155
156
157
# File 'lib/delivery/query_parameters/filters.rb', line 155

def range(*args)
  Kentico::Kontent::Delivery::QueryParameters::Filter.new(self, '[range]', *args)
end