Class: Restspec::Endpoints::Request

Inherits:
Struct
  • Object
show all
Defined in:
lib/restspec/endpoints/request.rb

Overview

A bag for request data.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#endpointObject

Allows to set the endpoint used to generate this request.



6
7
8
# File 'lib/restspec/endpoints/request.rb', line 6

def endpoint
  @endpoint
end

#headersObject

Returns the value of attribute headers

Returns:

  • (Object)

    the current value of headers



4
5
6
# File 'lib/restspec/endpoints/request.rb', line 4

def headers
  @headers
end

#methodObject

Returns the value of attribute method

Returns:

  • (Object)

    the current value of method



4
5
6
# File 'lib/restspec/endpoints/request.rb', line 4

def method
  @method
end

#payloadObject

Returns the value of attribute payload

Returns:

  • (Object)

    the current value of payload



4
5
6
# File 'lib/restspec/endpoints/request.rb', line 4

def payload
  @payload
end

#urlObject

Returns the value of attribute url

Returns:

  • (Object)

    the current value of url



4
5
6
# File 'lib/restspec/endpoints/request.rb', line 4

def url
  @url
end

Instance Method Details

#raw_payloadString

Returns a json encoded payload.

Returns:

  • (String)

    a json encoded payload



9
10
11
# File 'lib/restspec/endpoints/request.rb', line 9

def raw_payload
  @raw_payload ||= (payload || '').to_json
end