Sha256: 5693317416a0864bdaa4557585657436117626a15959ed2d35b1b4df1c7baa3b

Contents?: true

Size: 878 Bytes

Versions: 4

Compression:

Stored size: 878 Bytes

Contents

# encoding: utf-8

module QueryBuilder::CQL

  module Contexts

    # Describes the Cassandra user-defined aggregate
    #
    class Aggregate < Base

      attribute :keyspace, required: true
      attribute :name, required: true

      # Returns the full name of the aggregate
      #
      # @return [String]
      #
      def to_s
        [keyspace, name].join(".")
      end

      # Builds the 'CREATE AGGREGATE' CQL statement
      #
      # @return [QueryBuilder::Statements::CreateAggregate]
      #
      def create
        Statements::CreateAggregate.new(context: self)
      end

      # Builds the 'DROP AGGREGATE' CQL statement
      #
      # @return [QueryBuilder::Statements::DropAggregate]
      #
      def drop
        Statements::DropAggregate.new(context: self)
      end

    end # class Aggregate

  end # module Contexts

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/contexts/aggregate.rb
query_builder-0.0.3 lib/query_builder/cql/contexts/aggregate.rb
query_builder-0.0.2 lib/query_builder/cql/contexts/aggregate.rb
query_builder-0.0.1 lib/query_builder/cql/contexts/aggregate.rb