Class: ConsoleUtils::RequestUtils::Remo

Inherits:
Requester
  • Object
show all
Defined in:
lib/console_utils/request_utils/remo.rb

Constant Summary collapse

OUT_FORMAT =
"\n%{size_download}\n%{time_total}".freeze
INSPECT_FORMAT =
"<Remote: %s in %s ms>".freeze
INSPECT_NOTHING =
"<Remote: nothing>".freeze

Constants inherited from Requester

ConsoleUtils::RequestUtils::Requester::INFO_HASH_FIELDS

Instance Attribute Summary collapse

Attributes inherited from Requester

#url

Instance Method Summary collapse

Methods inherited from Requester

#pbcopy, #preview, #print_info, #size, #time, #to_info_hash

Instance Attribute Details

#request_methodObject (readonly)

Returns the value of attribute request_method.



10
11
12
# File 'lib/console_utils/request_utils/remo.rb', line 10

def request_method
  @request_method
end

Instance Method Details

#inspectObject



21
22
23
24
25
26
27
# File 'lib/console_utils/request_utils/remo.rb', line 21

def inspect
  if @url && @_time
    format(INSPECT_FORMAT, @url, @_time)
  else
    INSPECT_NOTHING
  end
end

#to_sObject



29
30
31
# File 'lib/console_utils/request_utils/remo.rb', line 29

def to_s
  @_body
end