Class: GoCardlessPro::Resources::Webhook
- Inherits:
-
Object
- Object
- GoCardlessPro::Resources::Webhook
- Defined in:
- lib/gocardless_pro/resources/webhook.rb
Overview
Basic description of a webhook
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#is_test ⇒ Object
readonly
Returns the value of attribute is_test.
-
#request_body ⇒ Object
readonly
Returns the value of attribute request_body.
-
#request_headers ⇒ Object
readonly
Returns the value of attribute request_headers.
-
#response_body ⇒ Object
readonly
Returns the value of attribute response_body.
-
#response_body_truncated ⇒ Object
readonly
Returns the value of attribute response_body_truncated.
-
#response_code ⇒ Object
readonly
Returns the value of attribute response_code.
-
#response_headers ⇒ Object
readonly
Returns the value of attribute response_headers.
-
#response_headers_content_truncated ⇒ Object
readonly
Returns the value of attribute response_headers_content_truncated.
-
#response_headers_count_truncated ⇒ Object
readonly
Returns the value of attribute response_headers_count_truncated.
-
#successful ⇒ Object
readonly
Returns the value of attribute successful.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #api_response ⇒ Object
-
#initialize(object, response = nil) ⇒ Webhook
constructor
Initialize a webhook resource instance.
-
#to_h ⇒ Object
Provides the webhook resource as a hash of all its readable attributes.
Constructor Details
#initialize(object, response = nil) ⇒ Webhook
Initialize a webhook resource instance
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/gocardless_pro/resources/webhook.rb', line 31 def initialize(object, response = nil) @object = object @created_at = object['created_at'] @id = object['id'] @is_test = object['is_test'] @request_body = object['request_body'] @request_headers = object['request_headers'] @response_body = object['response_body'] @response_body_truncated = object['response_body_truncated'] @response_code = object['response_code'] @response_headers = object['response_headers'] @response_headers_content_truncated = object['response_headers_content_truncated'] @response_headers_count_truncated = object['response_headers_count_truncated'] @successful = object['successful'] @url = object['url'] @response = response end |
Instance Attribute Details
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
15 16 17 |
# File 'lib/gocardless_pro/resources/webhook.rb', line 15 def created_at @created_at end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
16 17 18 |
# File 'lib/gocardless_pro/resources/webhook.rb', line 16 def id @id end |
#is_test ⇒ Object (readonly)
Returns the value of attribute is_test.
17 18 19 |
# File 'lib/gocardless_pro/resources/webhook.rb', line 17 def is_test @is_test end |
#request_body ⇒ Object (readonly)
Returns the value of attribute request_body.
18 19 20 |
# File 'lib/gocardless_pro/resources/webhook.rb', line 18 def request_body @request_body end |
#request_headers ⇒ Object (readonly)
Returns the value of attribute request_headers.
19 20 21 |
# File 'lib/gocardless_pro/resources/webhook.rb', line 19 def request_headers @request_headers end |
#response_body ⇒ Object (readonly)
Returns the value of attribute response_body.
20 21 22 |
# File 'lib/gocardless_pro/resources/webhook.rb', line 20 def response_body @response_body end |
#response_body_truncated ⇒ Object (readonly)
Returns the value of attribute response_body_truncated.
21 22 23 |
# File 'lib/gocardless_pro/resources/webhook.rb', line 21 def response_body_truncated @response_body_truncated end |
#response_code ⇒ Object (readonly)
Returns the value of attribute response_code.
22 23 24 |
# File 'lib/gocardless_pro/resources/webhook.rb', line 22 def response_code @response_code end |
#response_headers ⇒ Object (readonly)
Returns the value of attribute response_headers.
23 24 25 |
# File 'lib/gocardless_pro/resources/webhook.rb', line 23 def response_headers @response_headers end |
#response_headers_content_truncated ⇒ Object (readonly)
Returns the value of attribute response_headers_content_truncated.
24 25 26 |
# File 'lib/gocardless_pro/resources/webhook.rb', line 24 def response_headers_content_truncated @response_headers_content_truncated end |
#response_headers_count_truncated ⇒ Object (readonly)
Returns the value of attribute response_headers_count_truncated.
25 26 27 |
# File 'lib/gocardless_pro/resources/webhook.rb', line 25 def response_headers_count_truncated @response_headers_count_truncated end |
#successful ⇒ Object (readonly)
Returns the value of attribute successful.
26 27 28 |
# File 'lib/gocardless_pro/resources/webhook.rb', line 26 def successful @successful end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
27 28 29 |
# File 'lib/gocardless_pro/resources/webhook.rb', line 27 def url @url end |
Instance Method Details
#api_response ⇒ Object
50 51 52 |
# File 'lib/gocardless_pro/resources/webhook.rb', line 50 def api_response ApiResponse.new(@response) end |
#to_h ⇒ Object
Provides the webhook resource as a hash of all its readable attributes
55 56 57 |
# File 'lib/gocardless_pro/resources/webhook.rb', line 55 def to_h @object end |