Class: CriteriaOperator::OperandProperty

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

Overview

Operator that stores a property (e.g. column name). 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(property_name) ⇒ Void

The constructor for the operand. Expects the property name as parameter.

Parameters:

  • property_name (String)

    the name of the property described by this operand



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

def initialize(property_name)
  self.property_name = property_name
end

Instance Attribute Details

#property_nameString

Returns the name of the property described by this operand.

Returns:

  • (String)

    the name of the property described by this operand.



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

def property_name
  @property_name
end

Instance Method Details

#cloneOperandProperty

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_property.rb', line 23

def clone
  OperandProperty.new self.property_name
end