Class: Savon::LogMessage
- Inherits:
-
Object
- Object
- Savon::LogMessage
- Defined in:
- lib/savon/log_message.rb
Instance Attribute Summary collapse
-
#filter ⇒ Object
Returns the value of attribute filter.
-
#message ⇒ Object
Returns the value of attribute message.
-
#with_filter ⇒ Object
Returns the value of attribute with_filter.
-
#with_pretty ⇒ Object
Returns the value of attribute with_pretty.
Instance Method Summary collapse
- #filter? ⇒ Boolean
-
#initialize(message, filter, options = {}) ⇒ LogMessage
constructor
A new instance of LogMessage.
- #pretty? ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(message, filter, options = {}) ⇒ LogMessage
Returns a new instance of LogMessage.
4 5 6 7 8 9 |
# File 'lib/savon/log_message.rb', line 4 def initialize(, filter, = {}) self. = self.filter = filter self.with_pretty = [:pretty] self.with_filter = [:filter] end |
Instance Attribute Details
#filter ⇒ Object
Returns the value of attribute filter.
11 12 13 |
# File 'lib/savon/log_message.rb', line 11 def filter @filter end |
#message ⇒ Object
Returns the value of attribute message.
11 12 13 |
# File 'lib/savon/log_message.rb', line 11 def @message end |
#with_filter ⇒ Object
Returns the value of attribute with_filter.
11 12 13 |
# File 'lib/savon/log_message.rb', line 11 def with_filter @with_filter end |
#with_pretty ⇒ Object
Returns the value of attribute with_pretty.
11 12 13 |
# File 'lib/savon/log_message.rb', line 11 def with_pretty @with_pretty end |
Instance Method Details
#filter? ⇒ Boolean
13 14 15 |
# File 'lib/savon/log_message.rb', line 13 def filter? with_filter && filter.any? end |
#pretty? ⇒ Boolean
17 18 19 |
# File 'lib/savon/log_message.rb', line 17 def pretty? with_pretty end |
#to_s ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/savon/log_message.rb', line 21 def to_s return unless pretty? || filter? doc = Nokogiri::XML() doc = apply_filter(doc) if filter? doc.to_xml() end |