Class: Spandx::Spdx::License

Inherits:
Object
  • Object
show all
Defined in:
lib/spandx/spdx/license.rb

Direct Known Subclasses

CompositeLicense

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#attributesObject (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

Returns:

  • (Boolean)


36
37
38
# File 'lib/spandx/spdx/license.rb', line 36

def deprecated_license_id?
  attributes[:isDeprecatedLicenseId]
end

#idObject



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

#inspectObject



72
73
74
# File 'lib/spandx/spdx/license.rb', line 72

def inspect
  "#<Spandx::Spdx::License id='#{id}'>"
end

#nameObject



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

Returns:

  • (Boolean)


48
49
50
# File 'lib/spandx/spdx/license.rb', line 48

def osi_approved?
  attributes[:isOsiApproved]
end

#referenceObject



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_numberObject



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_alsoObject



52
53
54
# File 'lib/spandx/spdx/license.rb', line 52

def see_also
  attributes[:seeAlso]
end

#to_sObject



68
69
70
# File 'lib/spandx/spdx/license.rb', line 68

def to_s
  id
end

#urlObject



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