Class: Cuprum::Collections::Queries::ParseBlock::Builder

Inherits:
BasicObject
Defined in:
lib/cuprum/collections/queries/parse_block.rb

Overview

Evaluation context for query blocks.

Instance Method Summary collapse

Instance Method Details

#equals(value) ⇒ Array Also known as: equal, eq

Generates an equality criterion.

Returns:

  • (Array)

    the equality criterion.



57
58
59
# File 'lib/cuprum/collections/queries/parse_block.rb', line 57

def equals(value)
  [nil, Operators::EQUAL, value]
end

#greater_than(value) ⇒ Array Also known as: gt

Generates a greater than comparison criterion.

Returns:

  • (Array)

    the greater than criterion.



66
67
68
# File 'lib/cuprum/collections/queries/parse_block.rb', line 66

def greater_than(value)
  [nil, Operators::GREATER_THAN, value]
end

#greater_than_or_equal_to(value) ⇒ Array Also known as: gte

Generates a greater than or equal to comparison criterion.

Returns:

  • (Array)

    the greater than or equal to criterion.



74
75
76
# File 'lib/cuprum/collections/queries/parse_block.rb', line 74

def greater_than_or_equal_to(value)
  [nil, Operators::GREATER_THAN_OR_EQUAL_TO, value]
end

#less_than(value) ⇒ Array Also known as: lt

Generates a less than comparison criterion.

Returns:

  • (Array)

    the less than criterion.



82
83
84
# File 'lib/cuprum/collections/queries/parse_block.rb', line 82

def less_than(value)
  [nil, Operators::LESS_THAN, value]
end

#less_than_or_equal_to(value) ⇒ Array Also known as: lte

Generates a less than or equal to comparison criterion.

Returns:

  • (Array)

    the less than or equal to criterion.



90
91
92
# File 'lib/cuprum/collections/queries/parse_block.rb', line 90

def less_than_or_equal_to(value)
  [nil, Operators::LESS_THAN_OR_EQUAL_TO, value]
end

#not_equal(value) ⇒ Array Also known as: ne

Generates a negated equality criterion.

Returns:

  • (Array)

    the negated equality criterion.



98
99
100
# File 'lib/cuprum/collections/queries/parse_block.rb', line 98

def not_equal(value)
  [nil, Operators::NOT_EQUAL, value]
end

#not_one_of(value) ⇒ Array

Generates a negated inclusion criterion.

Returns:

  • (Array)

    the negated inclusion criterion.



106
107
108
# File 'lib/cuprum/collections/queries/parse_block.rb', line 106

def not_one_of(value)
  [nil, Operators::NOT_ONE_OF, value]
end

#one_of(value) ⇒ Array

Generates an inclusion criterion.

Returns:

  • (Array)

    the inclusion criterion.



113
114
115
# File 'lib/cuprum/collections/queries/parse_block.rb', line 113

def one_of(value)
  [nil, Operators::ONE_OF, value]
end