Class: Nexus::Artifact
- Inherits:
-
Object
- Object
- Nexus::Artifact
- Defined in:
- lib/nexus/artifact.rb
Instance Attribute Summary collapse
-
#classifier ⇒ Object
Returns the value of attribute classifier.
-
#group ⇒ Object
Returns the value of attribute group.
-
#name ⇒ Object
Returns the value of attribute name.
-
#repo ⇒ Object
Returns the value of attribute repo.
-
#type ⇒ Object
Returns the value of attribute type.
-
#uri ⇒ Object
Returns the value of attribute uri.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(parameters) ⇒ Artifact
constructor
A new instance of Artifact.
- #to_hash ⇒ Object
Constructor Details
#initialize(parameters) ⇒ Artifact
Returns a new instance of Artifact.
4 5 6 7 8 9 10 11 12 |
# File 'lib/nexus/artifact.rb', line 4 def initialize(parameters) @group = parameters['groupId'] @name = parameters['artifactId'] @version = parameters['version'] @type = parameters['packaging'] @uri = parameters['resourceURI'] @repo = parameters['repoId'] @classifier = parameters['classifier'] end |
Instance Attribute Details
#classifier ⇒ Object
Returns the value of attribute classifier.
2 3 4 |
# File 'lib/nexus/artifact.rb', line 2 def classifier @classifier end |
#group ⇒ Object
Returns the value of attribute group.
2 3 4 |
# File 'lib/nexus/artifact.rb', line 2 def group @group end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/nexus/artifact.rb', line 2 def name @name end |
#repo ⇒ Object
Returns the value of attribute repo.
2 3 4 |
# File 'lib/nexus/artifact.rb', line 2 def repo @repo end |
#type ⇒ Object
Returns the value of attribute type.
2 3 4 |
# File 'lib/nexus/artifact.rb', line 2 def type @type end |
#uri ⇒ Object
Returns the value of attribute uri.
2 3 4 |
# File 'lib/nexus/artifact.rb', line 2 def uri @uri end |
#version ⇒ Object
Returns the value of attribute version.
2 3 4 |
# File 'lib/nexus/artifact.rb', line 2 def version @version end |
Instance Method Details
#==(other) ⇒ Object
26 27 28 |
# File 'lib/nexus/artifact.rb', line 26 def == other to_hash == other.to_hash end |
#to_hash ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/nexus/artifact.rb', line 14 def to_hash hash = {} hash['groupId'] = group hash['artifactId'] = name hash['version'] = version hash['packaging'] = type hash['resourceURI'] = uri hash['repoId'] = repo hash['classifier'] = classifier hash end |