Class: Conekta::Resource
- Inherits:
-
ConektaObject
- Object
- Hash
- ConektaObject
- Conekta::Resource
- Defined in:
- lib/conekta/resource.rb
Direct Known Subclasses
Card, Charge, Customer, Event, Method, Payee, PaymentMethod, Payout, PayoutMethod, Plan, Subscription, Token, WebhookLog
Instance Attribute Summary
Attributes inherited from ConektaObject
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from ConektaObject
#class_name, class_name, #create_attr, #first, #initialize, #inspect, #last, #load_from, #set_val, #to_s, #unset_key
Constructor Details
This class inherits a constructor from Conekta::ConektaObject
Class Method Details
.url ⇒ Object
3 4 5 |
# File 'lib/conekta/resource.rb', line 3 def self.url() "/#{CGI.escape(self.class_name.downcase)}s" end |
Instance Method Details
#url ⇒ Object
6 7 8 9 10 |
# File 'lib/conekta/resource.rb', line 6 def url raise Error.new(I18n.t('error.resource.id', {resource: self.class.class_name, locale: :en}), I18n.t('error.resource.id', {resource: self.class.class_name, locale: Conekta.locale.to_sym})) if (id.nil? || id.empty?) return [self.class.url, id].join('/') end |