Skip to content

Conversation

@sardavend
Copy link
Contributor

@sardavend sardavend commented Jul 11, 2023

What does this PR do?

Improve the library interface to a new Resource/Model based API by leveraging the ruby meta-programming capabilities, this way we remove the hardcoded dependencies attributes of any Fintoc's resources and also abstract away the Client object to be implicitly called by the resources/models instead of using it directly by the library users

Details

Quick start usage with the current interface

client = Fintoc::Client.new('sk_test_9c8d8CeyBTx1VcJzuDgpm4H-bywJCeSx')
link = client.get_link('6n12zLmai3lLE9Dq_token_gvEJi8FrBge4fb3cz7Wp856W')
account = link.find(type: 'checking_account')

Quick start usage with the improved interface

Fintoc.api_key = 'sk_test_9c8d8CeyBTx1VcJzuDgpm4H-bywJCeSx'
link = Fintoc::Link.find('6n12zLmai3lLE9Dq_token_gvEJi8FrBge4fb3cz7Wp856W')
account = link.accounts.find(type: 'checking_account')

Get the las 30 movements with the current interface

movements = account.get_movements
movements = account.get_movements(since: '2020-08-15')

Get the las 30 movements with the improved interface

movements = account.movements
movements = account.movements(since: '2020-08-15')

@sardavend sardavend marked this pull request as draft July 11, 2023 04:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant