lib/sepa/utilities.rb
# Loads a soap or application request xml template according to a parameter and command.
#
# @param template [String] path to a template directory. Currently supported values are defined
#   in contants {AR_TEMPLATE_PATH} and {SOAP_TEMPLATE_PATH}.
# @return [Nokogiri::XML::Document] the loaded template
# @raise [ArgumentError] if a template cannot be found for a command
Loads a soap or application request xml template according to a parameter and command.
Loads a soap or application request xml template according to a parameter and command .
def load_body_template(template)
      raise ArgumentError, 'Unsupported command' unless SUPPORTED_COMMANDS.include?(@command)
      file = if STANDARD_COMMANDS.include?(@command)
               "#{template}/#{@command}.xml"
             else
               "#{template}/#{@bank}/#{@command}.xml"
             end
      xml_doc(File.open(file))
    end
def load_body_template ( template ) raise ArgumentError , 'Unsupported command' unless SUPPORTED_COMMANDS . include? ( @command ) file = if STANDARD_COMMANDS . include? ( @command ) "#{template}/#{@command}.xml" else "#{template}/#{@bank}/#{@command}.xml" end xml_doc ( File . open ( file ) ) end
Loads a soap or application request xml template according to a parameter and command.
Loads a soap or application request xml template according to a parameter and command .
the loaded template
the loaded template
Nokogiri::XML::Document
[ArgumentError] if a template cannot be found for a command
[ ArgumentError ] if a template cannot be found for a command
template
path to a template directory. Currently supported values are defined in contants {AR_TEMPLATE_PATH} and {SOAP_TEMPLATE_PATH}.
path to a template directory . Currently supported values are defined in contants { AR_TEMPLATE_PATH } and { SOAP_TEMPLATE_PATH } .