Sha256: b006e1363b8f29ae4d0971c52c689bb4f1c9c3c73da435eea0fb9fc989f1dd7e

Contents?: true

Size: 642 Bytes

Versions: 4

Compression:

Stored size: 642 Bytes

Contents

# encoding: utf-8

module QueryBuilder::CQL

  module Statements

    # Describes the 'GRANT' CQL3 statement
    #
    class ListPermissions < Base

      include Modifiers::Norecursive

      attribute :name, required: true

      # Builds the statement
      #
      # @return [String]
      #
      def to_s
        cql[
          "LIST", permission, "ON", context.to_s, "OF", name, maybe_norecursive
        ]
      end

      private

      def permission
        context.name ? "#{context.name.upcase} PERMISSION" : "ALL PERMISSIONS"
      end

    end # class ListPermissions

  end # module Statements

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