Class: BridgeBankin::Category

Inherits:
BridgeObject show all
Extended by:
API::Resource
Defined in:
lib/bridge_bankin/category.rb

Overview

Category resource

Constant Summary collapse

RESOURCE_TYPE =
"category"

Constants inherited from BridgeObject

BridgeObject::HIDDEN_ATTRIBUTES

Class Method Summary collapse

Methods inherited from BridgeObject

#==, convert_to_bridge_object, #initialize, #to_hash, #to_json

Constructor Details

This class inherits a constructor from BridgeBankin::BridgeObject

Class Method Details

.find(id:, **params) ⇒ Category

Retrieve a single category

Parameters:

  • id (Integer)

    the id of the requested resource

  • params (Hash)

    any params that might be required (or optional) to communicate with the API

Returns:


33
34
35
36
# File 'lib/bridge_bankin/category.rb', line 33

def find(id:, **params)
  data = api_client.get("/v2/categories/#{id}", params)
  convert_to_bridge_object(data)
end

.list(**params) ⇒ Array<Category>

List all categories supported by the Bridge API

Parameters:

  • params (Hash)

    any params that might be required (or optional) to communicate with the API

Returns:

  • (Array<Category>)

    the supported categories list


20
21
22
23
# File 'lib/bridge_bankin/category.rb', line 20

def list(**params)
  data = api_client.get("/v2/categories", params)
  convert_to_bridge_object(data)
end