lib/zuora/utils/envelope.rb in zuora-ruby-0.6.0 vs lib/zuora/utils/envelope.rb in zuora-ruby-0.7.0
- old
+ new
@@ -1,10 +1,11 @@
# frozen_string_literal: true
+
module Zuora
module Utils
module Envelope
- CUSTOM_FIELD_STRING = '__c'.freeze
+ CUSTOM_FIELD_STRING = '__c'
# @param [Callable] header - optional function of builder, rtns builder
# @param [Callable] body - optional function of builder, rtns builder
def self.xml(header, body)
Nokogiri::XML::Builder.new do |builder|
@@ -18,10 +19,10 @@
# Takes a body, and returns an envelope with session token merged in
# @param [Callable] body - function of body
# @return [Nokogiri::XML::Builder]
def self.authenticated_xml(token, &body)
failure_message = 'Session token not set. Did you call authenticate?'
- fail failure_message unless token.present?
+ raise failure_message unless token.present?
header = lambda do |builder|
builder[:api].SessionHeader { builder[:api].session(token) }
builder
end