Module: Deltacloud::BackendCapability

Included in:
Sinatra::Rabbit::Operation
Defined in:
lib/deltacloud/backend_capability.rb

Defined Under Namespace

Classes: Failure

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#capabilityObject (readonly)

Returns the value of attribute capability.



11
12
13
# File 'lib/deltacloud/backend_capability.rb', line 11

def capability
  @capability
end

Instance Method Details

#check_capability(backend) ⇒ Object



16
17
18
19
20
# File 'lib/deltacloud/backend_capability.rb', line 16

def check_capability(backend)
  if capability and !backend.respond_to?(capability)
    raise Failure.new(capability, "#{capability} capability not supported by backend #{backend.class.name}")
  end
end

#with_capability(capability) ⇒ Object



12
13
14
# File 'lib/deltacloud/backend_capability.rb', line 12

def with_capability(capability)
  @capability = capability
end