Sha256: 5a54f71d45b10e40166a09abc857b92be5bc763af2a02d3e8aeeb99a79c31373

Contents?: true

Size: 713 Bytes

Versions: 29

Compression:

Stored size: 713 Bytes

Contents

module CFoundry::V2
  module ModelMagic
    module QueryValueHelper
      class QueryValue
        attr_accessor :comparator, :value
        def initialize(params)
          self.comparator = params[:comparator] || params[:comp] || ':'
          self.value = params[:value]
        end

        def to_s
          "#{comparator_string}#{value_string}"
        end

        def comparator_string
          if comparator.downcase == 'in' || value.is_a?(Array)
            " IN "
          else
            comparator
          end
        end

        def value_string
          if value.is_a? Array
            value.join(",")
          else
            value
          end
        end
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 3 rubygems

Version Path
new_cfoundry-4.9.4 lib/cfoundry/v2/model_magic/query_value_helper.rb
new_cfoundry-4.9.3 lib/cfoundry/v2/model_magic/query_value_helper.rb
ncfoundry-4.9.4 lib/cfoundry/v2/model_magic/query_value_helper.rb
ncfoundry-4.9.3 lib/cfoundry/v2/model_magic/query_value_helper.rb
ncfoundry-4.9.2 lib/cfoundry/v2/model_magic/query_value_helper.rb
new_cfoundry-4.9.2 lib/cfoundry/v2/model_magic/query_value_helper.rb
new_cfoundry-4.9.1 lib/cfoundry/v2/model_magic/query_value_helper.rb
new_cfoundry-4.9.0 lib/cfoundry/v2/model_magic/query_value_helper.rb
new_cfoundry-4.8.3 lib/cfoundry/v2/model_magic/query_value_helper.rb
new_cfoundry-4.8.2 lib/cfoundry/v2/model_magic/query_value_helper.rb
cfoundry-4.7.2.rc1 lib/cfoundry/v2/model_magic/query_value_helper.rb
cfoundry-4.7.1 lib/cfoundry/v2/model_magic/query_value_helper.rb
cfoundry-4.7.1.rc1 lib/cfoundry/v2/model_magic/query_value_helper.rb
cfoundry-4.7.0 lib/cfoundry/v2/model_magic/query_value_helper.rb
cfoundry-4.6.3.rc3 lib/cfoundry/v2/model_magic/query_value_helper.rb
cfoundry-4.6.3.rc2 lib/cfoundry/v2/model_magic/query_value_helper.rb
cfoundry-4.6.3.rc1 lib/cfoundry/v2/model_magic/query_value_helper.rb
cfoundry-4.6.2 lib/cfoundry/v2/model_magic/query_value_helper.rb
cfoundry-4.6.1 lib/cfoundry/v2/model_magic/query_value_helper.rb
cfoundry-4.6.0 lib/cfoundry/v2/model_magic/query_value_helper.rb