Exception: Library::VersionConflict

Inherits:
LoadError
  • Object
show all
Defined in:
lib/library/version.rb

Overview

VersionConflict is raised when selecting another version of a library when a previous version has already been selected.

Instance Method Summary collapse

Constructor Details

#initialize(lib1, lib2 = nil) ⇒ VersionConflict

Setup conflict error instance.



245
246
247
248
# File 'lib/library/version.rb', line 245

def initialize(lib1, lib2=nil)
  @lib1 = lib1
  @lib2 = lib2
end

Instance Method Details

#to_sObject



253
254
255
256
257
258
259
# File 'lib/library/version.rb', line 253

def to_s
  if @lib2
    @lib1.inspect + " vs. " + @lib2.inspect
  else
    "previously selected version -- #{@lib1.inspect}"
  end
end