Module: Savon::Model

Defined in:
lib/savon/model.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(base) ⇒ Object



5
6
7
# File 'lib/savon/model.rb', line 5

def self.extended(base)
  base.setup
end

Instance Method Details

#all_operationsObject



25
26
27
# File 'lib/savon/model.rb', line 25

def all_operations
  operations(*client.operations)
end

#operations(*operations) ⇒ Object

Accepts one or more SOAP operations and generates both class and instance methods named after the given operations. Each generated method accepts an optional SOAP message Hash. Raises ArgumentError for reserved model method names, before defining any methods.



17
18
19
20
21
22
23
# File 'lib/savon/model.rb', line 17

def operations(*operations)
  operations.map { |operation| [operation, operation_method_name(operation)] }.each do |operation, method_name|
    define_class_operation(operation, method_name)
    define_instance_operation(method_name)
  end
  operations
end

#setupObject



9
10
11
12
# File 'lib/savon/model.rb', line 9

def setup
  class_operation_module
  instance_operation_module
end