Class: Savon::LogMessage
- Inherits:
-
Object
- Object
- Savon::LogMessage
- Defined in:
- lib/savon/log_message.rb
Instance Method Summary collapse
-
#initialize(message, filters = [], pretty_print = false) ⇒ LogMessage
constructor
A new instance of LogMessage.
- #to_s ⇒ Object
Constructor Details
#initialize(message, filters = [], pretty_print = false) ⇒ LogMessage
Returns a new instance of LogMessage.
6 7 8 9 10 |
# File 'lib/savon/log_message.rb', line 6 def initialize(, filters = [], pretty_print = false) @message = @filters = filters @pretty_print = pretty_print end |
Instance Method Details
#to_s ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/savon/log_message.rb', line 12 def to_s = @message =~ /^</ has_filters = @filters.any? pretty_print = @pretty_print return @message unless return @message unless has_filters || pretty_print document = Nokogiri.XML(@message) document = apply_filter(document) if has_filters document.to_xml() end |