Class: Ethon::Easy::DebugInfo Private
- Inherits:
-
Object
- Object
- Ethon::Easy::DebugInfo
- Defined in:
- lib/ethon/easy/debug_info.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
This class is used to store and retreive debug information, which is only saved when verbose is set to true.
Defined Under Namespace
Classes: Message
Constant Summary collapse
- MESSAGE_TYPES =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Ethon::Curl::DebugInfoType.to_h.keys
Instance Method Summary collapse
- #add(type, message) ⇒ Object private
-
#initialize ⇒ DebugInfo
constructor
private
A new instance of DebugInfo.
- #messages_for(type) ⇒ Object private
- #to_a ⇒ Object private
- #to_h ⇒ Object private
Constructor Details
#initialize ⇒ DebugInfo
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of DebugInfo.
22 23 24 |
# File 'lib/ethon/easy/debug_info.rb', line 22 def initialize @messages = [] end |
Instance Method Details
#add(type, message) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
26 27 28 |
# File 'lib/ethon/easy/debug_info.rb', line 26 def add(type, ) @messages << Message.new(type, ) end |
#messages_for(type) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
30 31 32 |
# File 'lib/ethon/easy/debug_info.rb', line 30 def (type) @messages.select {|m| m.type == type }.map(&:message) end |
#to_a ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
38 39 40 |
# File 'lib/ethon/easy/debug_info.rb', line 38 def to_a @messages.map(&:message) end |
#to_h ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
42 43 44 |
# File 'lib/ethon/easy/debug_info.rb', line 42 def to_h Hash[MESSAGE_TYPES.map {|k| [k, send(k)] }] end |