Sha256: 098df2c547e5a1f832173bcc8febc1a9b3c7a0748a22f8df1d8ade41d973da67

Contents?: true

Size: 834 Bytes

Versions: 3

Compression:

Stored size: 834 Bytes

Contents

require 'criteria_operator/base_operator'

module CriteriaOperator

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

    # @return [Object] the stored value.
    attr_accessor :value

    # The constructor for this operand. Expects the value as parameter.
    # @param [Object] value the value of the operand
    # @return [Void]
    def initialize(value)
      self.value = value
    end

    # 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}.
    # @return [OperandValue] the cloned operator
    def clone
      OperandValue.new self.value
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
criteria_operator-0.3.1 lib/criteria_operator/operand_value.rb
criteria_operator-0.3.0 lib/criteria_operator/operand_value.rb
criteria_operator-0.2.0 lib/criteria_operator/operand_value.rb