Sha256: efa89878bbbf228ad04ba0fde69e6b6ebf29ff42134e07b38023ba13f1426b4c

Contents?: true

Size: 931 Bytes

Versions: 30

Compression:

Stored size: 931 Bytes

Contents

module Fog
  module Vcloud
    module Generators

      def unauthenticated_basic_request(*args)
        self.class_eval <<-EOS, __FILE__,__LINE__
          def #{args[0]}(uri)
            unauthenticated_request({
              :expects => #{args[1] || 200},
              :method  => '#{args[2] || 'GET'}',
              :headers => #{args[3] ? args[3].inspect : '{}'},
              :parse => true,
              :uri     => uri })
          end
        EOS
      end

      def basic_request(*args)
        self.class_eval <<-EOS, __FILE__,__LINE__
          def #{args[0]}(uri)
            request({
              :expects => #{args[1] || 200},
              :method  => '#{args[2] || 'GET'}',
              :headers => #{args[3] ? args[3].inspect : '{}'},
              :body => '#{args[4] ? args[4] : ''}',
              :parse => true,
              :uri     => uri })
          end
        EOS
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 2 rubygems

Version Path
fog-0.2.30 lib/fog/vcloud/generators.rb
fog-0.2.28 lib/fog/vcloud/generators.rb
fog-0.2.27 lib/fog/vcloud/generators.rb
fog-0.2.26 lib/fog/vcloud/generators.rb
fog-0.2.25 lib/fog/vcloud/generators.rb
fog-0.2.24 lib/fog/vcloud/generators.rb
tecnh-fog-0.2.23.vpc lib/fog/vcloud/generators.rb
fog-0.2.23 lib/fog/vcloud/generators.rb
fog-0.2.22 lib/fog/vcloud/generators.rb
fog-0.2.21 lib/fog/vcloud/generators.rb
fog-0.2.20 lib/fog/vcloud/generators.rb
fog-0.2.19 lib/fog/vcloud/generators.rb
fog-0.2.18 lib/fog/vcloud/generators.rb
fog-0.2.17 lib/fog/vcloud/generators.rb
fog-0.2.16 lib/fog/vcloud/generators.rb
fog-0.2.15 lib/fog/vcloud/generators.rb
fog-0.2.14 lib/fog/vcloud/generators.rb
fog-0.2.13 lib/fog/vcloud/generators.rb
fog-0.2.12 lib/fog/vcloud/generators.rb
fog-0.2.11 lib/fog/vcloud/generators.rb