Class: PermissionsParser
- Inherits:
-
Object
- Object
- PermissionsParser
- Defined in:
- lib/cancan-permits/loader/permissions_parser.rb
Instance Method Summary collapse
-
#initialize ⇒ PermissionsParser
constructor
A new instance of PermissionsParser.
- #parse(key, obj) {|license| ... } ⇒ Object
Constructor Details
#initialize ⇒ PermissionsParser
Returns a new instance of PermissionsParser.
2 3 |
# File 'lib/cancan-permits/loader/permissions_parser.rb', line 2 def initialize end |
Instance Method Details
#parse(key, obj) {|license| ... } ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/cancan-permits/loader/permissions_parser.rb', line 5 def parse(key, obj, &blk) license = ::PermissionConfig.new key case obj when Hash (obj, license, &blk) else raise "Each key must have a YAML hash that defines its permission configuration" end yield license if blk end |