Class: TreezorConnect::ApiResource
- Inherits:
-
TreezorObject
- Object
- TreezorObject
- TreezorConnect::ApiResource
- Includes:
- TreezorConnect::ApiOperations::Request
- Defined in:
- lib/treezor_connect/api_resource.rb
Direct Known Subclasses
Beneficiary, BeneficiaryValidation, Card, CardImage, Document, MassPayout, Payin, Payout, Sca::ExternalOperation, Sca::Passcode, Sca::Wallet, SctInst::Payin, SctInst::Recall, TaxResidence, User
Class Method Summary collapse
- .custom_action(http_method, *actions, ignores_id: false, first_letter_upcased: false) ⇒ Object
- .resource_url ⇒ Object
Methods included from TreezorConnect::ApiOperations::Request
Methods inherited from TreezorObject
constantize_object_class, construct_from, create_instance, define_readers, extract_id, #initialize, set_attributes, #to_hash
Constructor Details
This class inherits a constructor from TreezorConnect::TreezorObject
Class Method Details
.custom_action(http_method, *actions, ignores_id: false, first_letter_upcased: false) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/treezor_connect/api_resource.rb', line 14 def custom_action(http_method, *actions, ignores_id: false, first_letter_upcased: false) actions.each do |action| case http_method when :post define_method_with_params(http_method, action, first_letter_upcased) when :put, :patch define_put_path_methods(http_method, action, ignores_id, first_letter_upcased) else raise ArgumentError, "Unsupported HTTP method: #{http_method}" end end end |
.resource_url ⇒ Object
8 9 10 11 12 |
# File 'lib/treezor_connect/api_resource.rb', line 8 def resource_url raise NotImplementedError, 'APIResource is an abstract class. You should perform actions ' \ 'on its subclasses (Payin, Payout, Transfer ...)' end |