Class: MangoPay::Resource
Abstract
- Inherits:
-
Object
- Object
- MangoPay::Resource
show all
- Defined in:
- lib/mangopay/resource.rb
Overview
Direct Known Subclasses
BankAccount, BankingAliases, Card, CardRegistration, Client, Conversion, Deposit, Dispute, Event, Hook, KycDocument, Mandate, PayIn, PayIn::ApplePay::Direct, PayIn::Bancontact::Web, PayIn::BankWire::Direct, PayIn::BankWire::ExternalInstruction, PayIn::Blik::Web, PayIn::Card::Direct, PayIn::Card::Web, PayIn::DirectDebit::Direct, PayIn::DirectDebit::Web, PayIn::Giropay::Web, PayIn::GooglePay::Direct, PayIn::Ideal::Web, PayIn::Klarna::Web, PayIn::Mbway::Web, PayIn::Multibanco::Web, PayIn::PayPal::Web, PayIn::Payconiq::Web, PayIn::PreAuthorized::Direct, PayIn::RecurringPayments::CIT, PayIn::RecurringPayments::MIT, PayIn::RecurringPayments::Recurring, PayIn::Satispay::Web, PayIn::Swish::Web, PayIn::Twint::Web, PayOut, PayOut::BankWire, PayOut::InstantPayoutEligibility::Reachability, PaymentMethodMetadata, PreAuthorization, Refund, Regulatory, Report, Transaction, Transfer, Ubo, UboDeclaration, User, VirtualAccount, Wallet
Class Method Summary
collapse
Class Method Details
.class_name ⇒ Object
5
6
7
|
# File 'lib/mangopay/resource.rb', line 5
def class_name
name.split('::').last
end
|
.url(id = nil) ⇒ Object
9
10
11
12
13
14
15
16
17
18
|
# File 'lib/mangopay/resource.rb', line 9
def url(id = nil)
if self == Resource
raise NotImplementedError.new('Resource is an abstract class. Do not use it directly.')
end
if id
"#{MangoPay.api_path}/#{CGI.escape(class_name.downcase)}s/#{CGI.escape(id.to_s)}"
else
"#{MangoPay.api_path}/#{CGI.escape(class_name.downcase)}s"
end
end
|