Sha256: 8d100fdb95acad22f1be5fe990c6f8b0ed49d2e69d17864d333cb119737f3f4f

Contents?: true

Size: 495 Bytes

Versions: 18

Compression:

Stored size: 495 Bytes

Contents

class Gratan::DSL::Context::On
  include Gratan::DSL::Validator

  attr_reader :result

  def initialize(user, host, object, options, &block)
    @object_identifier = "User `#{user}@#{host}` on `#{object}`"
    @user = user
    @host = host
    @object = object
    @options = options
    @result = []
    instance_eval(&block)
  end

  def grant(name, options = {})
    __validate("Grant `#{name}` is already defined") do
      not @result.include?(name)
    end

    @result << name
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
gratan-0.2.9 lib/gratan/dsl/context/on.rb
gratan-0.2.9.beta3 lib/gratan/dsl/context/on.rb
gratan-0.2.9.beta2 lib/gratan/dsl/context/on.rb
gratan-0.2.9.beta lib/gratan/dsl/context/on.rb
gratan-0.2.8 lib/gratan/dsl/context/on.rb
gratan-0.2.8.beta3 lib/gratan/dsl/context/on.rb
gratan-0.2.8.beta2 lib/gratan/dsl/context/on.rb
gratan-0.2.8.beta lib/gratan/dsl/context/on.rb
gratan-0.2.7 lib/gratan/dsl/context/on.rb
gratan-0.2.6 lib/gratan/dsl/context/on.rb
gratan-0.2.5 lib/gratan/dsl/context/on.rb
gratan-0.2.4 lib/gratan/dsl/context/on.rb
gratan-0.2.3 lib/gratan/dsl/context/on.rb
gratan-0.2.2 lib/gratan/dsl/context/on.rb
gratan-0.2.1 lib/gratan/dsl/context/on.rb
gratan-0.2.0 lib/gratan/dsl/context/on.rb
gratan-0.1.9 lib/gratan/dsl/context/on.rb
gratan-0.1.8 lib/gratan/dsl/context/on.rb