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.



68
69
70
71
72
73
# File 'lib/bundler/patch/advisory_consolidator.rb', line 68

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.



66
67
68
# File 'lib/bundler/patch/advisory_consolidator.rb', line 66

def gem_name
  @gem_name
end

#new_versionObject (readonly)

Returns the value of attribute new_version.



66
67
68
# File 'lib/bundler/patch/advisory_consolidator.rb', line 66

def new_version
  @new_version
end

#old_versionObject (readonly)

Returns the value of attribute old_version.



66
67
68
# File 'lib/bundler/patch/advisory_consolidator.rb', line 66

def old_version
  @old_version
end

#patched_versionsObject (readonly)

Returns the value of attribute patched_versions.



66
67
68
# File 'lib/bundler/patch/advisory_consolidator.rb', line 66

def patched_versions
  @patched_versions
end

Instance Method Details

#<=>(other) ⇒ Object



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

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

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#hashObject



79
80
81
# File 'lib/bundler/patch/advisory_consolidator.rb', line 79

def hash
  @gem_name.hash
end