Sha256: 218a1da5a7e24e771e6b3f143274016960763b39e10da9bc022fb6d8cb60dc81

Contents?: true

Size: 593 Bytes

Versions: 7

Compression:

Stored size: 593 Bytes

Contents

module CanTango
  module Permits
    class Permit
      module License
        def licenses *names
          names.to_strings.each do |name|
            try_license name
          end
        end

        protected

        def try_license name
          module_name = "#{name.camelize}License"
          clazz = module_name.constantize
          clazz.new(self).license_rules
        rescue NameError
          raise "License #{module_name} is not defined"
        rescue
          raise "License #{clazz} could not be enforced using #{self.inspect}"
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
cantango-0.9.4.7 lib/cantango/permits/permit/license.rb
cantango-0.9.4.6 lib/cantango/permits/permit/license.rb
cantango-0.9.4.5 lib/cantango/permits/permit/license.rb
cantango-0.9.4.3 lib/cantango/permits/permit/license.rb
cantango-0.9.4.2 lib/cantango/permits/permit/license.rb
cantango-0.9.4.1 lib/cantango/permits/permit/license.rb
cantango-0.9.4 lib/cantango/permits/permit/license.rb