Class: Dynamicloud::API::Criteria::BetweenCondition

Inherits:
Condition
  • Object
show all
Defined in:
lib/dynamic_criteria.rb

Overview

End of EqualCondition class

Constant Summary

Constants inherited from Condition

Condition::ROOT, Condition::WITHOUT

Instance Method Summary collapse

Constructor Details

#initialize(field, left, right) ⇒ BetweenCondition

Builds an instance with a specific field whose value should be between left and right

Parameters:

  • field

    field in this condition

  • left

    left part of the between condition

  • right

    right part of the between condition



136
137
138
139
140
# File 'lib/dynamic_criteria.rb', line 136

def initialize(field, left, right)
  @field = field
  @left = left
  @right = right
end

Instance Method Details

#to_record_string(parent) ⇒ Object

This method will return a String of this condition

Parameters:

  • parent

    this is the parent of this condition

Returns:

  • a json



145
146
147
# File 'lib/dynamic_criteria.rb', line 145

def to_record_string(parent)
  "\"" + @field + "\": { \"$between\": [" + (transform_left_right) + ']}'
end