Class: Gitlab::Git::DeclaredLicense
- Inherits:
-
Object
- Object
- Gitlab::Git::DeclaredLicense
- Defined in:
- lib/gitlab/git/declared_license.rb
Overview
DeclaredLicense is the software license declared in a LICENSE or COPYING file in the git repository.
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
SPDX Identifier for the license.
-
#name ⇒ Object
readonly
Full name of the license.
-
#nickname ⇒ Object
readonly
Nickname of the license (optional, a shorter user-friendly name).
-
#path ⇒ Object
Filename of the file containing license.
-
#url ⇒ Object
readonly
URL that points to the LICENSE.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(key: nil, name: nil, nickname: nil, url: nil, path: nil) ⇒ DeclaredLicense
constructor
A new instance of DeclaredLicense.
Constructor Details
#initialize(key: nil, name: nil, nickname: nil, url: nil, path: nil) ⇒ DeclaredLicense
Returns a new instance of DeclaredLicense.
23 24 25 26 27 28 29 |
# File 'lib/gitlab/git/declared_license.rb', line 23 def initialize(key: nil, name: nil, nickname: nil, url: nil, path: nil) @key = key @name = name @nickname = nickname @url = url @path = path end |
Instance Attribute Details
#key ⇒ Object (readonly)
SPDX Identifier for the license
9 10 11 |
# File 'lib/gitlab/git/declared_license.rb', line 9 def key @key end |
#name ⇒ Object (readonly)
Full name of the license
12 13 14 |
# File 'lib/gitlab/git/declared_license.rb', line 12 def name @name end |
#nickname ⇒ Object (readonly)
Nickname of the license (optional, a shorter user-friendly name)
15 16 17 |
# File 'lib/gitlab/git/declared_license.rb', line 15 def nickname @nickname end |
#path ⇒ Object
Filename of the file containing license
18 19 20 |
# File 'lib/gitlab/git/declared_license.rb', line 18 def path @path end |
#url ⇒ Object (readonly)
URL that points to the LICENSE
21 22 23 |
# File 'lib/gitlab/git/declared_license.rb', line 21 def url @url end |
Instance Method Details
#==(other) ⇒ Object
31 32 33 34 35 |
# File 'lib/gitlab/git/declared_license.rb', line 31 def ==(other) return unless other.is_a?(self.class) key == other.key end |