Sha256: 364afdfebc1c47ce820a5b23db2aa791fd8ffad1c8b662eb53faac69d64eeb49

Contents?: true

Size: 781 Bytes

Versions: 4

Compression:

Stored size: 781 Bytes

Contents

# encoding: utf-8

module QueryBuilder::CQL

  module Modifiers

    # Provides WITH OPTIONS clauses for statements
    #
    module WithOptions

      # Adds WITH OPTIONS clause to the statement
      #
      # @param [Hash] options
      #
      # @return [QueryBuilder::Core::Statement] updated statement
      #
      def with(options)
        self << Clause.new(column: :options, value: options)
      end

      private

      def maybe_with
        list = clauses(:with)
        ["WITH", list.last] if list.any?
      end

      # The clause for adding to a statement
      #
      # @api private
      #
      class Clause < BaseCondition

        type :with

      end # class Clause

    end # module WithOptions

  end # module Modifiers

end # module QueryBuilder::CQL

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
query_builder-0.0.4 lib/query_builder/cql/modifiers/with_options.rb
query_builder-0.0.3 lib/query_builder/cql/modifiers/with_options.rb
query_builder-0.0.2 lib/query_builder/cql/modifiers/with_options.rb
query_builder-0.0.1 lib/query_builder/cql/modifiers/with_options.rb