Class: CriteriaOperator::OperandValue

Inherits:
BaseOperator show all
Defined in:
lib/criteria_operator/operand_value.rb

Overview

Operator that holds a value. This operator is an operand, thus it is always a leaf of the expression tree.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseOperator

deserialize, serialize, #serialize

Constructor Details

#initialize(value) ⇒ Void

The constructor for this operand. Expects the value as parameter.

Parameters:

  • value (Object)

    the value of the operand



15
16
17
# File 'lib/criteria_operator/operand_value.rb', line 15

def initialize(value)
  self.value = value
end

Instance Attribute Details

#valueObject

Returns the stored value.

Returns:

  • (Object)

    the stored value.



10
11
12
# File 'lib/criteria_operator/operand_value.rb', line 10

def value
  @value
end

Instance Method Details

#cloneOperandValue

Clones an operator with all sub-operators, creating a deep copy. Since this is an operand, there are no sub-operators to clone. Implementation of the abstract BaseOperator#clone.

Returns:



23
24
25
# File 'lib/criteria_operator/operand_value.rb', line 23

def clone
  OperandValue.new self.value
end