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
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/gocardless_pro/resources/webhook.rb', line 20 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.
15 16 17 |
# File 'lib/gocardless_pro/resources/webhook.rb', line 15 def id @id end |
#is_test ⇒ Object (readonly)
Returns the value of attribute is_test.
15 16 17 |
# File 'lib/gocardless_pro/resources/webhook.rb', line 15 def is_test @is_test end |
#request_body ⇒ Object (readonly)
Returns the value of attribute request_body.
15 16 17 |
# File 'lib/gocardless_pro/resources/webhook.rb', line 15 def request_body @request_body end |
#request_headers ⇒ Object (readonly)
Returns the value of attribute request_headers.
15 16 17 |
# File 'lib/gocardless_pro/resources/webhook.rb', line 15 def request_headers @request_headers end |
#response_body ⇒ Object (readonly)
Returns the value of attribute response_body.
15 16 17 |
# File 'lib/gocardless_pro/resources/webhook.rb', line 15 def response_body @response_body end |
#response_body_truncated ⇒ Object (readonly)
Returns the value of attribute response_body_truncated.
15 16 17 |
# File 'lib/gocardless_pro/resources/webhook.rb', line 15 def response_body_truncated @response_body_truncated end |
#response_code ⇒ Object (readonly)
Returns the value of attribute response_code.
15 16 17 |
# File 'lib/gocardless_pro/resources/webhook.rb', line 15 def response_code @response_code end |
#response_headers ⇒ Object (readonly)
Returns the value of attribute response_headers.
15 16 17 |
# File 'lib/gocardless_pro/resources/webhook.rb', line 15 def response_headers @response_headers end |
#response_headers_content_truncated ⇒ Object (readonly)
Returns the value of attribute response_headers_content_truncated.
15 16 17 |
# File 'lib/gocardless_pro/resources/webhook.rb', line 15 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.
15 16 17 |
# File 'lib/gocardless_pro/resources/webhook.rb', line 15 def response_headers_count_truncated @response_headers_count_truncated end |
#successful ⇒ Object (readonly)
Returns the value of attribute successful.
15 16 17 |
# File 'lib/gocardless_pro/resources/webhook.rb', line 15 def successful @successful end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
15 16 17 |
# File 'lib/gocardless_pro/resources/webhook.rb', line 15 def url @url end |
Instance Method Details
#api_response ⇒ Object
39 40 41 |
# File 'lib/gocardless_pro/resources/webhook.rb', line 39 def api_response ApiResponse.new(@response) end |
#to_h ⇒ Object
Provides the webhook resource as a hash of all its readable attributes
44 45 46 |
# File 'lib/gocardless_pro/resources/webhook.rb', line 44 def to_h @object end |