module Stir::Operations

Public Class Methods

included(base) click to toggle source
# File lib/stir/soap/operations.rb, line 3
def self.included(base)
  base.extend(ClassMethods)
end

Public Instance Methods

define_operations!() click to toggle source
# File lib/stir/soap/operations.rb, line 7
def define_operations!
  @operations = operations
  @operations.each do |op|
    next if self.methods.include?(op)
    self.class.send(:define_method, op) do |*args|
      @response = get_client.call(op, *args)
    end
  end
end
operations() click to toggle source
# File lib/stir/soap/operations.rb, line 17
def operations
  get_operations
end

Private Instance Methods

get_client() click to toggle source
# File lib/stir/soap/operations.rb, line 34
def get_client
  Savon.client(self.service_config.symbolize_keys)
end
get_operations() click to toggle source
# File lib/stir/soap/operations.rb, line 23
def get_operations
  operations = operations_available? ? get_client.operations : []
  operations << self.class.send(:operations)
  operations.flatten.uniq
end
operations_available?() click to toggle source
# File lib/stir/soap/operations.rb, line 29
def operations_available?
  return true if get_client.operations rescue RuntimeError
  false
end