Sha256: ab8f7cf74f132c3f21e00b3dd59beb056e9991b43333ccad8f6c34aedee01bcd

Contents?: true

Size: 981 Bytes

Versions: 3

Compression:

Stored size: 981 Bytes

Contents

require 'criteria_operator/base_operator'

module CriteriaOperator

  # Operator that stores a property (e.g. column name).
  # This operator is an operand, thus it is always a leaf of the expression tree.
  class OperandProperty < BaseOperator

    # @return [String] the name of the property described by this operand.
    attr_accessor :property_name

    # The constructor for the operand. Expects the property name as parameter.
    # @param [String] property_name the name of the property described by this operand
    # @return [Void]
    def initialize(property_name)
      self.property_name = property_name
    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 [OperandProperty] the cloned operator
    def clone
      OperandProperty.new self.property_name
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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