Class: Authorization::DevelopmentSupport::AnalyzerEngine::Rule
- Inherits:
-
Object
- Object
- Authorization::DevelopmentSupport::AnalyzerEngine::Rule
- Defined in:
- lib/declarative_authorization/development_support/development_support.rb
Constant Summary collapse
- @@rule_objects =
{}
Instance Attribute Summary collapse
-
#rule ⇒ Object
readonly
Returns the value of attribute rule.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(rule, engine) ⇒ Rule
constructor
A new instance of Rule.
- #privileges ⇒ Object
Constructor Details
#initialize(rule, engine) ⇒ Rule
Returns a new instance of Rule.
148 149 150 151 |
# File 'lib/declarative_authorization/development_support/development_support.rb', line 148 def initialize (rule, engine) @rule = rule @engine = engine end |
Instance Attribute Details
#rule ⇒ Object (readonly)
Returns the value of attribute rule.
147 148 149 |
# File 'lib/declarative_authorization/development_support/development_support.rb', line 147 def rule @rule end |
Class Method Details
.for_rule(rule, engine) ⇒ Object
155 156 157 |
# File 'lib/declarative_authorization/development_support/development_support.rb', line 155 def self.for_rule (rule, engine) @@rule_objects[[rule, engine]] ||= new(rule, engine) end |
Instance Method Details
#privileges ⇒ Object
152 153 154 |
# File 'lib/declarative_authorization/development_support/development_support.rb', line 152 def privileges PrivilegesSet.new(self, @engine, @rule.privileges.collect {|privilege| Privilege.for_sym(privilege, @engine) }) end |