Sha256: 0fbd3f903628ad7c014ac976b1fdf026b295422e10fcfa55d80c8aaaa75f4552

Contents?: true

Size: 546 Bytes

Versions: 4

Compression:

Stored size: 546 Bytes

Contents

# encoding: utf-8

module QueryBuilder::CQL

  module Statements

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

      attribute :name, required: true

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

      private

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

    end # class Grant

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