Class: Spandx::Spdx::License
- Inherits:
-
Object
- Object
- Spandx::Spdx::License
- Defined in:
- lib/spandx/spdx/license.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Class Method Summary collapse
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #deprecated_license_id? ⇒ Boolean
- #id ⇒ Object
- #id=(value) ⇒ Object
-
#initialize(attributes = {}) ⇒ License
constructor
A new instance of License.
- #inspect ⇒ Object
- #name ⇒ Object
- #name=(value) ⇒ Object
- #osi_approved? ⇒ Boolean
- #reference ⇒ Object
- #reference=(value) ⇒ Object
- #reference_number ⇒ Object
- #reference_number=(value) ⇒ Object
- #see_also ⇒ Object
- #to_s ⇒ Object
- #url ⇒ Object
- #url=(value) ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ License
Returns a new instance of License.
8 9 10 |
# File 'lib/spandx/spdx/license.rb', line 8 def initialize(attributes = {}) @attributes = attributes end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
6 7 8 |
# File 'lib/spandx/spdx/license.rb', line 6 def attributes @attributes end |
Class Method Details
.unknown(text) ⇒ Object
76 77 78 |
# File 'lib/spandx/spdx/license.rb', line 76 def self.unknown(text) new(licenseId: 'Nonstandard', name: text) end |
Instance Method Details
#<=>(other) ⇒ Object
64 65 66 |
# File 'lib/spandx/spdx/license.rb', line 64 def <=>(other) id <=> other.id end |
#deprecated_license_id? ⇒ Boolean
36 37 38 |
# File 'lib/spandx/spdx/license.rb', line 36 def deprecated_license_id? attributes[:isDeprecatedLicenseId] end |
#id ⇒ Object
12 13 14 |
# File 'lib/spandx/spdx/license.rb', line 12 def id attributes[:licenseId] end |
#id=(value) ⇒ Object
16 17 18 |
# File 'lib/spandx/spdx/license.rb', line 16 def id=(value) attributes[:licenseId] = value end |
#inspect ⇒ Object
72 73 74 |
# File 'lib/spandx/spdx/license.rb', line 72 def inspect "#<Spandx::Spdx::License id='#{id}'>" end |
#name ⇒ Object
20 21 22 |
# File 'lib/spandx/spdx/license.rb', line 20 def name attributes[:name] end |
#name=(value) ⇒ Object
24 25 26 |
# File 'lib/spandx/spdx/license.rb', line 24 def name=(value) attributes[:name] = value end |
#osi_approved? ⇒ Boolean
48 49 50 |
# File 'lib/spandx/spdx/license.rb', line 48 def osi_approved? attributes[:isOsiApproved] end |
#reference ⇒ Object
28 29 30 |
# File 'lib/spandx/spdx/license.rb', line 28 def reference attributes[:reference] end |
#reference=(value) ⇒ Object
32 33 34 |
# File 'lib/spandx/spdx/license.rb', line 32 def reference=(value) attributes[:reference] = value end |
#reference_number ⇒ Object
56 57 58 |
# File 'lib/spandx/spdx/license.rb', line 56 def reference_number attributes[:referenceNumber] end |
#reference_number=(value) ⇒ Object
60 61 62 |
# File 'lib/spandx/spdx/license.rb', line 60 def reference_number=(value) attributes[:referenceNumber] = value end |
#see_also ⇒ Object
52 53 54 |
# File 'lib/spandx/spdx/license.rb', line 52 def see_also attributes[:seeAlso] end |
#to_s ⇒ Object
68 69 70 |
# File 'lib/spandx/spdx/license.rb', line 68 def to_s id end |
#url ⇒ Object
40 41 42 |
# File 'lib/spandx/spdx/license.rb', line 40 def url attributes[:detailsUrl] end |
#url=(value) ⇒ Object
44 45 46 |
# File 'lib/spandx/spdx/license.rb', line 44 def url=(value) attributes[:detailsUrl] = value end |