The base class for all client products

Sections
Methods
B
N
P
Attributes
[R] client
Class Public methods
new(client)
# File lib/plaid/products/base_product.rb, line 38
def initialize(client)
  @client = client
end
Internal
Instance Protected methods
build_payload(access_token, account_ids: nil, options: nil)

Build a simple payload with access_token, options, and account_ids.

# File lib/plaid/products/base_product.rb, line 50
def build_payload(access_token, account_ids: nil, options: nil)
  options_payload = {}
  options_payload[:account_ids] = account_ids unless account_ids.nil?
  options_payload.merge!(options) unless options.nil?

  { access_token: access_token,
    options: options_payload }
end
post_with_auth(path, response_class, payload)

Do a POST to API and capture it into a response object.

# File lib/plaid/products/base_product.rb, line 60
def post_with_auth(path, response_class, payload)
  response_class.new(client.post_with_auth(path, payload))
end