Sha256: c4ab2777106178fd73189090c5fb68b69f1860e122690081d63f80a0cdaa2533

Contents?: true

Size: 1.01 KB

Versions: 4

Compression:

Stored size: 1.01 KB

Contents

# encoding: utf-8

module QueryBuilder::CQL

  module Contexts

    # Describes the Cassandra users role
    #
    class Role < Base

      attribute :name, required: true

      # Returns the full name of the type
      #
      # @return [String]
      #
      def to_s
        name.to_s
      end

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

      # Builds the 'ALTER ROLE' CQL statement with password
      #
      # @param [#to_s] password
      #
      # @return [QueryBuilder::Statements::AlterRole]
      #
      def alter(password)
        Statements::AlterRole.new(context: self).password(password)
      end

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

    end # class Role

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