Class: Posgra::DSL::Grants::Role::Schema::On
- Inherits:
-
Object
- Object
- Posgra::DSL::Grants::Role::Schema::On
- Includes:
- Logger::Helper, TemplateHelper
- Defined in:
- lib/posgra/dsl/grants/role/schema/on.rb
Instance Attribute Summary collapse
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
- #grant(name, options = {}) ⇒ Object
-
#initialize(context, object, options, &block) ⇒ On
constructor
A new instance of On.
Methods included from TemplateHelper
Methods included from Logger::Helper
Constructor Details
#initialize(context, object, options, &block) ⇒ On
Returns a new instance of On.
7 8 9 10 11 12 13 |
# File 'lib/posgra/dsl/grants/role/schema/on.rb', line 7 def initialize(context, object, , &block) @object = object @options = @context = context.merge(:object => object) @result = {} instance_eval(&block) end |
Instance Attribute Details
#result ⇒ Object (readonly)
Returns the value of attribute result.
5 6 7 |
# File 'lib/posgra/dsl/grants/role/schema/on.rb', line 5 def result @result end |
Instance Method Details
#grant(name, options = {}) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/posgra/dsl/grants/role/schema/on.rb', line 15 def grant(name, = {}) name = name.to_s @result[name] = { 'is_grantable' => !![:grantable] } end |