Method: LicenseFinder::AndLicense#initialize
- Defined in:
- lib/license_finder/license.rb
#initialize(name, operator = AndLicense.operator) ⇒ AndLicense
Returns a new instance of AndLicense.
97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/license_finder/license.rb', line 97 def initialize(name, operator = AndLicense.operator) @short_name = name @pretty_name = name @url = nil @spdx_id = nil @matcher = NoneMatcher.new # removes heading and trailing parentesis and splits name = name[1..-2] if name.start_with?('(') names = name.split(operator) @sub_licenses = names.map do |sub_name| License.find_by_name(sub_name) end end |