Class: ActionHook::Core::Request

Inherits:
Object
  • Object
show all
Includes:
Security::Headers
Defined in:
lib/actionhook/core/request.rb

Direct Known Subclasses

JSONRequest

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Security::Headers

#headers_with_security

Methods included from Security::Fingerprinting

#fingerprint

Constructor Details

#initialize(url:, method: :post, body: nil, headers: {}, secret: nil, authentication: nil) ⇒ Request

Returns a new instance of Request.



10
11
12
13
14
15
16
17
# File 'lib/actionhook/core/request.rb', line 10

def initialize(url:, method: :post, body: nil, headers: {}, secret: nil, authentication: nil)
  @url = url
  @method = method
  @body = body
  @headers = headers || {}
  @secret = secret
  @authentication = authentication
end

Instance Attribute Details

#authenticationObject

Returns the value of attribute authentication.



8
9
10
# File 'lib/actionhook/core/request.rb', line 8

def authentication
  @authentication
end

#bodyObject

Returns the value of attribute body.



8
9
10
# File 'lib/actionhook/core/request.rb', line 8

def body
  @body
end

#headersObject

Returns the value of attribute headers.



8
9
10
# File 'lib/actionhook/core/request.rb', line 8

def headers
  @headers
end

#methodObject

Returns the value of attribute method.



8
9
10
# File 'lib/actionhook/core/request.rb', line 8

def method
  @method
end

#secretObject

Returns the value of attribute secret.



8
9
10
# File 'lib/actionhook/core/request.rb', line 8

def secret
  @secret
end

#urlObject

Returns the value of attribute url.



8
9
10
# File 'lib/actionhook/core/request.rb', line 8

def url
  @url
end

Instance Method Details

#serialized_bodyObject



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

def serialized_body
  @body
end

#uriObject



23
24
25
# File 'lib/actionhook/core/request.rb', line 23

def uri
  @uri ||= URI.parse(url)
end