Class: Gratan::DSL::Context::On
- Inherits:
-
Object
- Object
- Gratan::DSL::Context::On
- Includes:
- Validator
- Defined in:
- lib/gratan/dsl/context/on.rb
Instance Attribute Summary collapse
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
- #grant(name, options = {}) ⇒ Object
-
#initialize(user, host, object, options, &block) ⇒ On
constructor
A new instance of On.
Methods included from Validator
Constructor Details
#initialize(user, host, object, options, &block) ⇒ On
Returns a new instance of On.
6 7 8 9 10 11 12 13 14 |
# File 'lib/gratan/dsl/context/on.rb', line 6 def initialize(user, host, object, , &block) @object_identifier = "User `#{user}@#{host}` on `#{object}`" @user = user @host = host @object = object @options = @result = [] instance_eval(&block) end |
Instance Attribute Details
#result ⇒ Object (readonly)
Returns the value of attribute result.
4 5 6 |
# File 'lib/gratan/dsl/context/on.rb', line 4 def result @result end |
Instance Method Details
#grant(name, options = {}) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/gratan/dsl/context/on.rb', line 16 def grant(name, = {}) __validate("Grant `#{name}` is already defined") do not @result.include?(name) end @result << name end |