Class: CanTango::Loader::License

Inherits:
Object
  • Object
show all
Defined in:
lib/cantango/permits_ext/loader/license.rb

Instance Method Summary collapse

Instance Method Details

#load_rules(name = nil) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/cantango/permits_ext/loader/license.rb', line 4

def load_rules name = nil
  return if !licenses || licenses.permissions.empty?
  name ||= self.class.to_s.gsub(/License$/, "").underscore

  return if licenses.permissions[name].nil?

  licenses.permissions[name].can_eval do |permission_statement|
    instance_eval permission_statement
  end
  licenses.permissions[name].cannot_eval do |permission_statement|
    instance_eval permission_statement
  end
end