Class: EndpointFlux::Request

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(headers: {}, remote_ip: '', params: {}, namespace: nil, trace_id: nil) ⇒ Request

Returns a new instance of Request.



5
6
7
8
9
10
11
# File 'lib/endpoint_flux/request.rb', line 5

def initialize(headers: {}, remote_ip: '', params: {}, namespace: nil, trace_id: nil)
  @headers = headers
  @remote_ip = remote_ip
  @params = params
  @namespace = namespace
  @trace_id = trace_id || SecureRandom.hex(32)
end

Instance Attribute Details

#endpointObject

Returns the value of attribute endpoint.



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

def endpoint
  @endpoint
end

#headersObject

Returns the value of attribute headers.



14
15
16
# File 'lib/endpoint_flux/request.rb', line 14

def headers
  @headers
end

#namespaceObject

Returns the value of attribute namespace.



16
17
18
# File 'lib/endpoint_flux/request.rb', line 16

def namespace
  @namespace
end

#paramsObject

Returns the value of attribute params.



13
14
15
# File 'lib/endpoint_flux/request.rb', line 13

def params
  @params
end

#remote_ipObject

Returns the value of attribute remote_ip.



15
16
17
# File 'lib/endpoint_flux/request.rb', line 15

def remote_ip
  @remote_ip
end

#scopeObject

Returns the value of attribute scope.



18
19
20
# File 'lib/endpoint_flux/request.rb', line 18

def scope
  @scope
end

#trace_idObject

Returns the value of attribute trace_id.



19
20
21
# File 'lib/endpoint_flux/request.rb', line 19

def trace_id
  @trace_id
end