Exception: Pangea::Backend::BackendIncompatible
- Defined in:
- lib/pangea/backend.rb
Overview
Raised when a workspace requires a feature the selected backend doesn’t support.
Instance Attribute Summary collapse
-
#alternatives ⇒ Object
readonly
Returns the value of attribute alternatives.
-
#backend ⇒ Object
readonly
Returns the value of attribute backend.
-
#feature ⇒ Object
readonly
Returns the value of attribute feature.
-
#hint ⇒ Object
readonly
Returns the value of attribute hint.
Instance Method Summary collapse
-
#initialize(backend:, feature:, alternatives: [], hint: nil) ⇒ BackendIncompatible
constructor
A new instance of BackendIncompatible.
Constructor Details
#initialize(backend:, feature:, alternatives: [], hint: nil) ⇒ BackendIncompatible
Returns a new instance of BackendIncompatible.
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/pangea/backend.rb', line 30 def initialize(backend:, feature:, alternatives: [], hint: nil) @backend = backend @feature = feature @alternatives = alternatives @hint = hint msg = +"backend=#{backend} does not support #{feature}.\n" unless alternatives.empty? msg << " Alternatives: #{alternatives.map { |a| "backend=#{a}" }.join(', ')}\n" end msg << " Hint: #{hint}\n" if hint super(msg) end |
Instance Attribute Details
#alternatives ⇒ Object (readonly)
Returns the value of attribute alternatives.
28 29 30 |
# File 'lib/pangea/backend.rb', line 28 def alternatives @alternatives end |
#backend ⇒ Object (readonly)
Returns the value of attribute backend.
28 29 30 |
# File 'lib/pangea/backend.rb', line 28 def backend @backend end |
#feature ⇒ Object (readonly)
Returns the value of attribute feature.
28 29 30 |
# File 'lib/pangea/backend.rb', line 28 def feature @feature end |
#hint ⇒ Object (readonly)
Returns the value of attribute hint.
28 29 30 |
# File 'lib/pangea/backend.rb', line 28 def hint @hint end |