Class: Yieldmanager::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/yieldmanager/builder.rb

Overview

Builds local copies of the Yieldmanager wsdls. These are used to dynamically-generate the service methods and instance variables in Yieldmanager::Client.

This shouldn’t need to be run by the end-user because the current version of the APIs are pre-generated in the gem.

At some point, the wsdls themselves will actually be used to build the objects.

Constant Summary collapse

TEST =
true
BASE_URL =
"https://api.yieldmanager.com/api-"
BASE_URL_TEST =
"https://api-test.yieldmanager.com/api-"
WSDL_DIR =
File.join(File.dirname(__FILE__), '..', '..', 'wsdls')

Class Method Summary collapse

Class Method Details

.build_wsdls_for(api_version) ⇒ Object



23
24
25
26
27
28
29
30
# File 'lib/yieldmanager/builder.rb', line 23

def self.build_wsdls_for api_version
  unless api_version.match(/^\d\.\d{2}/)
    raise ArgumentError, "Non-standard api version"
  end
  build_dirs_for api_version
  store_wsdls(BASE_URL, api_version, lookup_services(api_version))
  store_wsdls(BASE_URL_TEST, api_version, lookup_services(api_version), TEST)
end

.delete_wsdls_for(api_version) ⇒ Object



32
33
34
# File 'lib/yieldmanager/builder.rb', line 32

def self.delete_wsdls_for api_version
  FileUtils.rm_rf "#{WSDL_DIR}/#{api_version}"
end