Class: Metasploit::Framework::DataService::RemoteHTTPDataService::ResponseWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/metasploit/framework/data_service/remote/http/core.rb

Overview

Simple response wrapper

Direct Known Subclasses

ErrorResponse, SuccessResponse

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ ResponseWrapper

Returns a new instance of ResponseWrapper.



247
248
249
# File 'lib/metasploit/framework/data_service/remote/http/core.rb', line 247

def initialize(response)
  @response = response
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



245
246
247
# File 'lib/metasploit/framework/data_service/remote/http/core.rb', line 245

def response
  @response
end

Instance Method Details

#response_bodyObject



251
252
253
254
255
256
257
# File 'lib/metasploit/framework/data_service/remote/http/core.rb', line 251

def response_body
  if @response
    @response.body
  else
    nil
  end
end

#to_sObject



259
260
261
262
263
264
265
# File 'lib/metasploit/framework/data_service/remote/http/core.rb', line 259

def to_s
  if @response
    @response.to_s
  else
    ''
  end
end