Exception: Machinery::Errors::SystemDescriptionIncompatible
- Inherits:
-
SystemDescriptionError
- Object
- StandardError
- MachineryError
- SystemDescriptionError
- Machinery::Errors::SystemDescriptionIncompatible
- Defined in:
- lib/exceptions.rb
Instance Attribute Summary collapse
-
#format_version ⇒ Object
readonly
Returns the value of attribute format_version.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, format_version) ⇒ SystemDescriptionIncompatible
constructor
A new instance of SystemDescriptionIncompatible.
- #to_s ⇒ Object
Constructor Details
#initialize(name, format_version) ⇒ SystemDescriptionIncompatible
Returns a new instance of SystemDescriptionIncompatible.
48 49 50 51 |
# File 'lib/exceptions.rb', line 48 def initialize(name, format_version) @name = name @format_version = format_version end |
Instance Attribute Details
#format_version ⇒ Object (readonly)
Returns the value of attribute format_version.
46 47 48 |
# File 'lib/exceptions.rb', line 46 def format_version @format_version end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
46 47 48 |
# File 'lib/exceptions.rb', line 46 def name @name end |
Instance Method Details
#to_s ⇒ Object
53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/exceptions.rb', line 53 def to_s if !@format_version "#{@name}: incompatible format version. Can not be upgraded." elsif @format_version < SystemDescription::CURRENT_FORMAT_VERSION "#{@name}: format version #{@format_version}, needs to be upgraded. "\ "Try '#{Ui::Hint.program_name} upgrade-format #{name}'"\ " to upgrade it to the current version." else "#{@name}: format version #{@format_version}. " \ "Please upgrade Machinery to the latest version." end end |