Parent

Class/Module Index [+]

Quicksearch

Deltacloud::BaseDriver::FeatureDecl

The declaration of a feature, defines what operations are modified by it

Attributes

name[R]
operations[R]

Public Class Methods

new(name, &block) click to toggle source
# File lib/deltacloud/base_driver/features.rb, line 47
def initialize(name, &block)
  @name = name
  @operations = []
  instance_eval &block
end

Public Instance Methods

description(text=nil) click to toggle source
# File lib/deltacloud/base_driver/features.rb, line 53
def description(text=nil)
  @description = text if text
  @description
end
operation(name, &block) click to toggle source

Add/modify an operation or look up an existing one. If block is provided, create a new operation if none exists with name name. Evaluate the block against this instance. If no block is provided, look up the operation with name name

# File lib/deltacloud/base_driver/features.rb, line 62
def operation(name, &block)
  op = @operations.find { |op| op.name == name }
  if block_given?
    if op.nil?
      op = Operation.new(name, &block)
      @operations << op
    else
      op.instance_eval(&block)
    end
  end
  op
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.