A class which encapsulates information about a Plaid category.
[R] | hierarchy | The Array of String hierarchy. E.g. [“Food and Drink”, “Nightlife”]. |
[R] | id | The String category ID, e.g. “21010006”. |
[R] | type | The Symbol category type. One of :special, :place, :digital. |
Get information about all available categories.
Does a GET /categories call.
- client
-
The Plaid::Client instance used to connect (default: Plaid.client).
Returns
Returns an Array of Category instances.
Source: show
# File lib/plaid/category.rb, line 42 def self.all(client: nil) Connector.new(:categories, client: client).get.map do |category_data| new(category_data) end end
Get information about a given category.
Does a GET /categories/:id call.
- id
-
the String category ID (e.g. “17001013”).
- client
-
The Plaid::Client instance used to connect (default: Plaid.client).
Returns
Returns a Category instance or raises Plaid::NotFoundError if category with given id is not found.
Source: show
# File lib/plaid/category.rb, line 58 def self.get(id, client: nil) new Connector.new(:categories, id, client: client).get end
Source: show
# File lib/plaid/category.rb, line 24 def inspect "#<Plaid::Category id=#{id.inspect}, type=#{type.inspect}, " "hierarchy=#{hierarchy.inspect}>" end