Module: Fog::Vcloud::Extension

Includes:
Service
Included in:
Terremark::Ecloud, Terremark::Vcloud
Defined in:
lib/fog/vcloud/extension.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Service

#model, #model_path, #models, #request, #request_path, #requests, #requirements, #requires, #reset_data

Class Method Details

.extended(other) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/fog/vcloud/extension.rb', line 8

def self.extended(other)
  other.module_eval <<-EOS,__FILE__,__LINE__
    module #{other}::Real
      extend Fog::Vcloud::Generators
    end
    module #{other}::Mock
    end
    module #{other}::Versions
      SUPPORTED = @versions
    end
    def self.extended(klass)
      unless @required
        models.each do |model|
          require File.join(@model_path, model.to_s)
        end
        requests.each do |request|
          require File.join(@request_path, request.to_s)
        end
        @required = true
      end
      if Fog.mocking?
        klass.extend #{other}::Real
        klass.extend #{other}::Mock
      else
        klass.extend #{other}::Real
      end
    end
  EOS
end

Instance Method Details

#versions(*args) ⇒ Object



38
39
40
# File 'lib/fog/vcloud/extension.rb', line 38

def versions(*args)
  @versions = args
end