Class: Bundler::Patch::GemPatch
- Inherits:
-
Object
- Object
- Bundler::Patch::GemPatch
- Includes:
- Comparable
- Defined in:
- lib/bundler/patch/advisory_consolidator.rb
Instance Attribute Summary collapse
-
#gem_name ⇒ Object
readonly
Returns the value of attribute gem_name.
-
#new_version ⇒ Object
readonly
Returns the value of attribute new_version.
-
#old_version ⇒ Object
readonly
Returns the value of attribute old_version.
-
#patched_versions ⇒ Object
readonly
Returns the value of attribute patched_versions.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(gem_name:, old_version: nil, new_version: nil, patched_versions: nil) ⇒ GemPatch
constructor
A new instance of GemPatch.
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_name ⇒ Object (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_version ⇒ Object (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_version ⇒ Object (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_versions ⇒ Object (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
83 84 85 |
# File 'lib/bundler/patch/advisory_consolidator.rb', line 83 def eql?(other) @gem_name.eql?(other.gem_name) end |
#hash ⇒ Object
79 80 81 |
# File 'lib/bundler/patch/advisory_consolidator.rb', line 79 def hash @gem_name.hash end |