Class: Swgr2rb::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/request_sender/request.rb

Overview

Request contains all parameters necessary for making an API request. Its instances are being passed to ConductorSender.send_request.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(endpoint_name, type, headers, body) ⇒ Request

Returns a new instance of Request.



9
10
11
12
13
14
15
# File 'lib/request_sender/request.rb', line 9

def initialize(endpoint_name, type, headers, body)
  @endpoint_name = endpoint_name
  @type = type
  @headers = headers
  @body = body
  process_request_type
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



7
8
9
# File 'lib/request_sender/request.rb', line 7

def body
  @body
end

#endpoint_nameObject (readonly)

Returns the value of attribute endpoint_name.



7
8
9
# File 'lib/request_sender/request.rb', line 7

def endpoint_name
  @endpoint_name
end

#headersObject (readonly)

Returns the value of attribute headers.



7
8
9
# File 'lib/request_sender/request.rb', line 7

def headers
  @headers
end

#subdomainObject (readonly)

Returns the value of attribute subdomain.



7
8
9
# File 'lib/request_sender/request.rb', line 7

def subdomain
  @subdomain
end

#typeObject (readonly)

Returns the value of attribute type.



7
8
9
# File 'lib/request_sender/request.rb', line 7

def type
  @type
end

Instance Method Details

#urlObject



17
18
19
# File 'lib/request_sender/request.rb', line 17

def url
  generate_url
end