Class: CanTango::PermissionEngine::Parser::Permissions
- Inherits:
-
Object
- Object
- CanTango::PermissionEngine::Parser::Permissions
- Defined in:
- lib/cantango/permission_engine/parser/permissions.rb
Instance Method Summary collapse
-
#initialize ⇒ Permissions
constructor
A new instance of Permissions.
- #parse(key, obj) {|permission| ... } ⇒ Object
Constructor Details
#initialize ⇒ Permissions
Returns a new instance of Permissions.
6 7 |
# File 'lib/cantango/permission_engine/parser/permissions.rb', line 6 def initialize end |
Instance Method Details
#parse(key, obj) {|permission| ... } ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/cantango/permission_engine/parser/permissions.rb', line 9 def parse(key, obj, &blk) = CanTango::PermissionEngine::Permission.new key case obj when Hash (obj, , &blk) else raise "Each key must have a YAML hash that defines its permission configuration" end yield if blk end |