class Mercadopago::Endpoint::Base

Attributes

data[R]
rest_client[R]

Public Class Methods

new(rest_client, data) click to toggle source
# File lib/mercadopago/endpoint/base.rb, line 6
def initialize(rest_client, data)
  @rest_client = rest_client
  @data = data
end

Public Instance Methods

to_s() click to toggle source
# File lib/mercadopago/endpoint/base.rb, line 11
def to_s
  self.class.to_s.split("::").last.downcase
end

Protected Instance Methods

member_endpoint() click to toggle source
# File lib/mercadopago/endpoint/base.rb, line 16
def member_endpoint
  id = data[:id] || raise(StandardError.new('Unknown ID'))
  "#{self.class::ENDPOINT}/#{id}"
end