Module: Eloqua

Defined in:
lib/eloqua.rb,
lib/eloqua/api.rb,
lib/eloqua/asset.rb,
lib/eloqua/query.rb,
lib/eloqua/entity.rb,
lib/eloqua/version.rb,
lib/eloqua/api/action.rb,
lib/eloqua/api/service.rb,
lib/eloqua/builder/xml.rb,
lib/eloqua/remote_object.rb,
lib/eloqua/builder/templates.rb,
lib/eloqua/helper/attribute_map.rb

Defined Under Namespace

Modules: Builder, Helper Classes: Api, Asset, DuplicateRecordError, Entity, HTTPError, Query, RemoteError, RemoteObject, SoapError

Constant Summary collapse

VERSION =
"1.2.4"

Class Method Summary collapse

Class Method Details

.authenticate(user, password) ⇒ Object



19
20
21
22
# File 'lib/eloqua.rb', line 19

def self.authenticate(user, password)
  self.user = user
  self.password = password
end

.configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (Eloqua)

    the object that the method was called on



15
16
17
# File 'lib/eloqua.rb', line 15

def self.configure(&block)
  yield self
end

.delegate_with_args(from_klass, to_klass, methods, methods_to_argument) ⇒ Object



39
40
41
42
43
44
45
46
47
48
49
# File 'lib/eloqua.rb', line 39

def self.delegate_with_args(from_klass, to_klass, methods, methods_to_argument)
  argument_string = methods_to_argument.join(', ')
  methods.each do |__method_name|
    from_klass.module_eval(<<-RUBY)
      def self.#{__method_name}(*args, &block)
        #{to_klass}.__send__(#{__method_name.inspect}, #{argument_string}, *args, &block)
      end
    RUBY
  end

end

.format_results_for_array(results, *keys) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/eloqua.rb', line 24

def self.format_results_for_array(results, *keys)
  max_depth = keys.length
  depth = 0
  keys.each do |key|
    if(results.has_key?(key))
      depth += 1
      results = results[key]
    end
  end
  if(depth == max_depth && !results.is_a?(Array))
    results = [results]
  end
  results
end