<commit_before>require 'savon'
require 'soap-object/version'
require 'soap-object/class_methods'

module SoapObject
  attr_reader :wsdl

  def initialize
    @client = Savon.client(with_wsdl) if wsdl?
    @client = Savon.client(with_endpoint.merge(with_namespace)) if endpoint?
  end

  def self.included(cls)
    cls.extend SoapObject::ClassMethods
  end

  def connected?
    not @client.nil?
  end

  def operations
    @client.operations if wsdl?
  end

  def method_missing(*args)
    method = args.shift
    @response = @client.call(method, {message: args.first})
    body_for(method)
  end

  private

  def body_for(method)
    @response.body["#{method.to_s}_response".to_sym]["#{method.to_s}_result".to_sym]
  end
  
  def wsdl?
    respond_to? :with_wsdl
  end

  def endpoint?
    respond_to? :with_endpoint and respond_to? :with_namespace
  end
  
end<commit_msg>turned off logging<commit_after>require 'savon'
require 'soap-object/version'
require 'soap-object/class_methods'

module SoapObject
  attr_reader :wsdl

  def initialize
    @client = Savon.client(with_wsdl.merge(no_log)) if wsdl?
    @client = Savon.client(with_endpoint.merge(with_namespace).merge(no_log)) if endpoint?
  end

  def self.included(cls)
    cls.extend SoapObject::ClassMethods
  end

  def connected?
    not @client.nil?
  end

  def operations
    @client.operations if wsdl?
  end

  def method_missing(*args)
    method = args.shift
    @response = @client.call(method, {message: args.first})
    body_for(method)
  end

  private

  def body_for(method)
    @response.body["#{method.to_s}_response".to_sym]["#{method.to_s}_result".to_sym]
  end
  
  def wsdl?
    respond_to? :with_wsdl
  end

  def endpoint?
    respond_to? :with_endpoint and respond_to? :with_namespace
  end

  def no_log
    {log: false}
  end
end
{'fraction_non_alphanumeric': 0.10401761144744083, 'fraction_numerical': 0.0, 'mean_word_length': 3.7591623036649215, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5678684', 'n_tokens_mistral': 663, 'n_tokens_neox': 632, 'n_words': 138}