Class: Ethon::Easy::Mirror
- Inherits:
-
Object
- Object
- Ethon::Easy::Mirror
- Defined in:
- lib/ethon/easy/mirror.rb
Constant Summary collapse
- INFORMATIONS_TO_MIRROR =
Informations::AVAILABLE_INFORMATIONS.keys + [:return_code, :response_headers, :response_body, :debug_info]
- INFORMATIONS_TO_LOG =
[:effective_url, :response_code, :return_code, :total_time]
Instance Attribute Summary collapse
-
#options ⇒ Object
(also: #to_hash)
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Mirror
constructor
A new instance of Mirror.
- #log_informations ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Mirror
Returns a new instance of Mirror.
21 22 23 |
# File 'lib/ethon/easy/mirror.rb', line 21 def initialize( = {}) @options = end |
Instance Attribute Details
#options ⇒ Object (readonly) Also known as: to_hash
Returns the value of attribute options.
5 6 7 |
# File 'lib/ethon/easy/mirror.rb', line 5 def @options end |
Class Method Details
.from_easy(easy) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/ethon/easy/mirror.rb', line 13 def self.from_easy(easy) = {} INFORMATIONS_TO_MIRROR.each do |info| [info] = easy.send(info) end new() end |
Instance Method Details
#log_informations ⇒ Object
25 26 27 28 29 |
# File 'lib/ethon/easy/mirror.rb', line 25 def log_informations Hash[*INFORMATIONS_TO_LOG.map do |info| [info, [info]] end.flatten] end |