Sha256: a350c21cc38f45857640c7cafc9922d580882fccc99148c91045e857f7355c25
Contents?: true
Size: 612 Bytes
Versions: 8
Compression:
Stored size: 612 Bytes
Contents
class Gratan::DSL::Context::On include Gratan::DSL::Validator include Gratan::TemplateHelper attr_reader :result 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 def grant(name, options = {}) __validate("Grant `#{name}` is already defined") do not @result.include?(name) end @result << name end end
Version data entries
8 entries across 8 versions & 1 rubygems