Exception: Pangea::Backend::BackendIncompatible

Inherits:
StandardError
  • Object
show all
Defined in:
lib/pangea/backend.rb

Overview

Raised when a workspace requires a feature the selected backend doesn’t support.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#alternativesObject (readonly)

Returns the value of attribute alternatives.



28
29
30
# File 'lib/pangea/backend.rb', line 28

def alternatives
  @alternatives
end

#backendObject (readonly)

Returns the value of attribute backend.



28
29
30
# File 'lib/pangea/backend.rb', line 28

def backend
  @backend
end

#featureObject (readonly)

Returns the value of attribute feature.



28
29
30
# File 'lib/pangea/backend.rb', line 28

def feature
  @feature
end

#hintObject (readonly)

Returns the value of attribute hint.



28
29
30
# File 'lib/pangea/backend.rb', line 28

def hint
  @hint
end