Class: Bundler::Patch::GemPatch

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/bundler/patch/advisory_consolidator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(gem_name:, old_version: nil, new_version: nil, patched_versions: nil) ⇒ GemPatch

Returns a new instance of GemPatch.



75
76
77
78
79
80
# File 'lib/bundler/patch/advisory_consolidator.rb', line 75

def initialize(gem_name:, old_version: nil, new_version: nil, patched_versions: nil)
  @gem_name = gem_name
  @old_version = Gem::Version.new(old_version) if old_version
  @new_version = Gem::Version.new(new_version) if new_version
  @patched_versions = patched_versions
end

Instance Attribute Details

#gem_nameObject (readonly)

Returns the value of attribute gem_name.



73
74
75
# File 'lib/bundler/patch/advisory_consolidator.rb', line 73

def gem_name
  @gem_name
end

#new_versionObject (readonly)

Returns the value of attribute new_version.



73
74
75
# File 'lib/bundler/patch/advisory_consolidator.rb', line 73

def new_version
  @new_version
end

#old_versionObject (readonly)

Returns the value of attribute old_version.



73
74
75
# File 'lib/bundler/patch/advisory_consolidator.rb', line 73

def old_version
  @old_version
end

#patched_versionsObject (readonly)

Returns the value of attribute patched_versions.



73
74
75
# File 'lib/bundler/patch/advisory_consolidator.rb', line 73

def patched_versions
  @patched_versions
end

Instance Method Details

#<=>(other) ⇒ Object



82
83
84
# File 'lib/bundler/patch/advisory_consolidator.rb', line 82

def <=>(other)
  self.gem_name <=> other.gem_name
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


90
91
92
# File 'lib/bundler/patch/advisory_consolidator.rb', line 90

def eql?(other)
  @gem_name.eql?(other.gem_name)
end

#hashObject



86
87
88
# File 'lib/bundler/patch/advisory_consolidator.rb', line 86

def hash
  @gem_name.hash
end