Class: Nexus::Artifact

Inherits:
Object
  • Object
show all
Defined in:
lib/nexus/artifact.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#classifierObject

Returns the value of attribute classifier.



2
3
4
# File 'lib/nexus/artifact.rb', line 2

def classifier
  @classifier
end

#groupObject

Returns the value of attribute group.



2
3
4
# File 'lib/nexus/artifact.rb', line 2

def group
  @group
end

#nameObject

Returns the value of attribute name.



2
3
4
# File 'lib/nexus/artifact.rb', line 2

def name
  @name
end

#repoObject

Returns the value of attribute repo.



2
3
4
# File 'lib/nexus/artifact.rb', line 2

def repo
  @repo
end

#typeObject

Returns the value of attribute type.



2
3
4
# File 'lib/nexus/artifact.rb', line 2

def type
  @type
end

#uriObject

Returns the value of attribute uri.



2
3
4
# File 'lib/nexus/artifact.rb', line 2

def uri
  @uri
end

#versionObject

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_hashObject



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