Module: Typhoeus::EasyFu::Infos
- Included in:
- Typhoeus::Easy
- Defined in:
- lib/typhoeus/easy/infos.rb
Instance Method Summary collapse
- #app_connect_time ⇒ Object
- #auth_methods ⇒ Object
- #connect_time ⇒ Object
- #curl_error_message(code = @curl_return_code) ⇒ Object
- #curl_return_code ⇒ Object
- #curl_version ⇒ Object
- #effective_url ⇒ Object
- #get_info_double(option) ⇒ Object
- #get_info_long(option) ⇒ Object
- #get_info_string(option) ⇒ Object
- #name_lookup_time ⇒ Object
- #pretransfer_time ⇒ Object
- #primary_ip ⇒ Object
- #redirect_count ⇒ Object
- #response_code ⇒ Object
- #start_transfer_time ⇒ Object
- #supports_zlib? ⇒ Boolean
- #timed_out? ⇒ Boolean
- #total_time_taken ⇒ Object
Instance Method Details
#app_connect_time ⇒ Object
37 38 39 |
# File 'lib/typhoeus/easy/infos.rb', line 37 def app_connect_time get_info_double(:appconnect_time) end |
#auth_methods ⇒ Object
25 26 27 |
# File 'lib/typhoeus/easy/infos.rb', line 25 def auth_methods get_info_long(:httpauth_avail) end |
#connect_time ⇒ Object
45 46 47 |
# File 'lib/typhoeus/easy/infos.rb', line 45 def connect_time get_info_double(:connect_time) end |
#curl_error_message(code = @curl_return_code) ⇒ Object
77 78 79 |
# File 'lib/typhoeus/easy/infos.rb', line 77 def (code = @curl_return_code) code ? Curl.easy_strerror(code) : nil end |
#curl_return_code ⇒ Object
73 74 75 |
# File 'lib/typhoeus/easy/infos.rb', line 73 def curl_return_code Curl::EasyCode[@curl_return_code] end |
#curl_version ⇒ Object
81 82 83 |
# File 'lib/typhoeus/easy/infos.rb', line 81 def curl_version Curl.version end |
#effective_url ⇒ Object
53 54 55 |
# File 'lib/typhoeus/easy/infos.rb', line 53 def effective_url get_info_string(:effective_url) end |
#get_info_double(option) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/typhoeus/easy/infos.rb', line 18 def get_info_double(option) if Curl.easy_getinfo(@handle, option, double_ptr) == :ok double_ptr.read_double else nil end end |
#get_info_long(option) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/typhoeus/easy/infos.rb', line 11 def get_info_long(option) if Curl.easy_getinfo(@handle, option, long_ptr) == :ok long_ptr.read_long else nil end end |
#get_info_string(option) ⇒ Object
4 5 6 7 8 9 |
# File 'lib/typhoeus/easy/infos.rb', line 4 def get_info_string(option) if Curl.easy_getinfo(@handle, option, string_ptr) == :ok string_ptr.read_pointer.read_string else nil end end |
#name_lookup_time ⇒ Object
49 50 51 |
# File 'lib/typhoeus/easy/infos.rb', line 49 def name_lookup_time get_info_double(:namelookup_time) end |
#pretransfer_time ⇒ Object
41 42 43 |
# File 'lib/typhoeus/easy/infos.rb', line 41 def pretransfer_time get_info_double(:pretransfer_time) end |
#primary_ip ⇒ Object
57 58 59 |
# File 'lib/typhoeus/easy/infos.rb', line 57 def primary_ip get_info_string(:primary_ip) end |
#redirect_count ⇒ Object
69 70 71 |
# File 'lib/typhoeus/easy/infos.rb', line 69 def redirect_count get_info_long(:redirect_count) end |
#response_code ⇒ Object
61 62 63 |
# File 'lib/typhoeus/easy/infos.rb', line 61 def response_code get_info_long(:response_code) end |
#start_transfer_time ⇒ Object
33 34 35 |
# File 'lib/typhoeus/easy/infos.rb', line 33 def start_transfer_time get_info_double(:starttransfer_time) end |
#supports_zlib? ⇒ Boolean
85 86 87 |
# File 'lib/typhoeus/easy/infos.rb', line 85 def supports_zlib? !!(curl_version.match(/zlib/)) end |
#timed_out? ⇒ Boolean
65 66 67 |
# File 'lib/typhoeus/easy/infos.rb', line 65 def timed_out? @curl_return_code == :operation_timedout end |
#total_time_taken ⇒ Object
29 30 31 |
# File 'lib/typhoeus/easy/infos.rb', line 29 def total_time_taken get_info_double(:total_time) end |