Class: Maven::Model::Coordinate

Inherits:
Tag
  • Object
show all
Includes:
Tools::Coordinate
Defined in:
lib/maven/model/dependencies.rb

Direct Known Subclasses

Dependency, Parent, Plugin, Project

Instance Method Summary collapse

Methods included from Tools::Coordinate

#gav, #group_artifact, #to_coordinate, #to_version

Methods inherited from Tag

#_name, _tags, #comment, prepend_tags, tags, #to_xml

Constructor Details

#initialize(*args) ⇒ Coordinate

Returns a new instance of Coordinate.



61
62
63
# File 'lib/maven/model/dependencies.rb', line 61

def initialize(*args)
  @group_id, @artifact_id, @version = gav(*args.flatten)
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



73
74
75
# File 'lib/maven/model/dependencies.rb', line 73

def ==(other)
  group_id == other.group_id && artifact_id == other.artifact_id
end

#hashObject



69
70
71
# File 'lib/maven/model/dependencies.rb', line 69

def hash
  "#{group_id}:#{artifact_id}".hash
end

#version?Boolean

Returns:

  • (Boolean)


65
66
67
# File 'lib/maven/model/dependencies.rb', line 65

def version?
  !(@version.nil? || @version == '[0,)')
end