Class: LicenseFinder::AndLicense
- Defined in:
- lib/license_finder/license.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#sub_licenses ⇒ Object
readonly
Returns the value of attribute sub_licenses.
Attributes inherited from License
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, operator = AndLicense.operator) ⇒ AndLicense
constructor
A new instance of AndLicense.
Methods inherited from License
all, #eql?, find_by_name, find_by_text, #hash, #matches_name?, #matches_text?, #name, #stripped_name, #unrecognized_matcher?
Constructor Details
#initialize(name, operator = AndLicense.operator) ⇒ AndLicense
Returns a new instance of AndLicense.
85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/license_finder/license.rb', line 85 def initialize(name, operator = AndLicense.operator) @short_name = name @pretty_name = name @url = nil @matcher = NoneMatcher.new # removes heading and trailing parentesis and splits names = name[1..-2].split(operator) @sub_licenses = names.map do |sub_name| License.find_by_name(sub_name) end end |
Instance Attribute Details
#sub_licenses ⇒ Object (readonly)
Returns the value of attribute sub_licenses.
97 98 99 |
# File 'lib/license_finder/license.rb', line 97 def sub_licenses @sub_licenses end |
Class Method Details
.operator ⇒ Object
81 82 83 |
# File 'lib/license_finder/license.rb', line 81 def self.operator ' AND ' end |