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