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.
7 8 9 10 11 |
# File 'lib/savon/log_message.rb', line 7 def initialize(, filters = [], pretty_print = false) @message = @filters = filters @pretty_print = pretty_print end |
Instance Method Details
#to_s ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/savon/log_message.rb', line 13 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 |