Class: Spandx::Java::Metadata
- Inherits:
-
Object
- Object
- Spandx::Java::Metadata
- Defined in:
- lib/spandx/java/metadata.rb
Instance Attribute Summary collapse
-
#artifact_id ⇒ Object
readonly
Returns the value of attribute artifact_id.
-
#group_id ⇒ Object
readonly
Returns the value of attribute group_id.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(artifact_id:, group_id:, version:, source: 'https://repo.maven.apache.org/maven2') ⇒ Metadata
constructor
A new instance of Metadata.
- #licenses ⇒ Object
Constructor Details
#initialize(artifact_id:, group_id:, version:, source: 'https://repo.maven.apache.org/maven2') ⇒ Metadata
Returns a new instance of Metadata.
8 9 10 11 12 13 |
# File 'lib/spandx/java/metadata.rb', line 8 def initialize(artifact_id:, group_id:, version:, source: 'https://repo.maven.apache.org/maven2') @artifact_id = artifact_id @group_id = group_id.tr('.', '/') @version = version @source = source end |
Instance Attribute Details
#artifact_id ⇒ Object (readonly)
Returns the value of attribute artifact_id.
6 7 8 |
# File 'lib/spandx/java/metadata.rb', line 6 def artifact_id @artifact_id end |
#group_id ⇒ Object (readonly)
Returns the value of attribute group_id.
6 7 8 |
# File 'lib/spandx/java/metadata.rb', line 6 def group_id @group_id end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
6 7 8 |
# File 'lib/spandx/java/metadata.rb', line 6 def source @source end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
6 7 8 |
# File 'lib/spandx/java/metadata.rb', line 6 def version @version end |
Instance Method Details
#licenses ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/spandx/java/metadata.rb', line 15 def licenses return [] unless pom pom.search('//licenses/license').map do |node| { name: node.at_xpath('./name').text, url: node.at_xpath('./url').text } end end |