Sha256: e841948d90ee6bbcdd5446c71996ab0227f74f60436c4ddefdfd3fe85bb4c341
Contents?: true
Size: 594 Bytes
Versions: 5
Compression:
Stored size: 594 Bytes
Contents
class Gratan::DSL::Context::User include Gratan::DSL::Validator attr_reader :result def initialize(user, host, &block) @error_identifier = "User `#{user}@#{host}`" @user = user @host = host @result = {} instance_eval(&block) end def on(name, options = {}, &block) name = name.to_s __validate("Object `#{name}` is already defined") do not @result.has_key?(name) end grant = {:privs => Gratan::DSL::Context::On.new(@user, @host, name, &block).result} grant[:with] = options[:with] if options[:with] @result[name] = grant end end
Version data entries
5 entries across 5 versions & 1 rubygems