module CFF::Licensable

Functionality to add licence(s) to parts of the CFF model.

Public Instance Methods

license = license click to toggle source
license = Array

Set the license, or licenses, of this work. Only licenses that conform to the SPDX License List will be accepted. If you need specify a different license you should set license-url with a link to the license instead.

# File lib/cff/licensable.rb, line 33
def license=(lic)
  list = [*lic].select { |l| LICENSES.include?(l) }
  @fields['license'] = case list.length
                       when 0
                         @fields['license']
                       when 1
                         list[0]
                       else
                         list
                       end
end