class GoCardlessPro::Resources::Webhook

Basic description of a webhook

Attributes

created_at[R]
id[R]
is_test[R]
request_body[R]
request_headers[R]
response_body[R]
response_body_truncated[R]
response_code[R]
response_headers[R]
response_headers_content_truncated[R]
response_headers_count_truncated[R]
successful[R]
url[R]

Public Class Methods

new(object, response = nil) click to toggle source

Initialize a webhook resource instance @param object [Hash] an object returned from the API

# File lib/gocardless_pro/resources/webhook.rb, line 33
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

Public Instance Methods

api_response() click to toggle source
# File lib/gocardless_pro/resources/webhook.rb, line 52
def api_response
  ApiResponse.new(@response)
end
to_h() click to toggle source

Provides the webhook resource as a hash of all its readable attributes

# File lib/gocardless_pro/resources/webhook.rb, line 57
def to_h
  @object
end