class Gratan::DSL::Context::On

Attributes

result[R]

Public Class Methods

new(context, user, host, object, options, &block) click to toggle source
# File lib/gratan/dsl/context/on.rb, line 7
def initialize(context, user, host, object, options, &block)
  @object_identifier = "User `#{user}@#{host}` on `#{object}`"
  @user = user
  @host = host
  @object = object
  @options = options
  @context = context.merge(:object => object, :grant_options => options)
  @result = []
  instance_eval(&block)
end

Public Instance Methods

grant(name, options = {}) click to toggle source
# File lib/gratan/dsl/context/on.rb, line 18
def grant(name, options = {})
  __validate("Grant `#{name}` is already defined") do
    not @result.include?(name)
  end

  @result << name
end