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.
21 22 23 |
# File 'lib/ethon/easy/debug_info.rb', line 21 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.
25 26 27 |
# File 'lib/ethon/easy/debug_info.rb', line 25 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.
29 30 31 |
# File 'lib/ethon/easy/debug_info.rb', line 29 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.
37 38 39 |
# File 'lib/ethon/easy/debug_info.rb', line 37 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.
41 42 43 |
# File 'lib/ethon/easy/debug_info.rb', line 41 def to_h Hash[MESSAGE_TYPES.map {|k| [k, send(k)] }] end |