Sha256: 7d9d7a6fdeed7c35fd3ee1d97a233d0cd5be9af1b278f5b4c54c07241fe83df6
Contents?: true
Size: 538 Bytes
Versions: 12
Compression:
Stored size: 538 Bytes
Contents
module MangoPay # @abstract class Resource class << self def class_name name.split('::').last end 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 end end end
Version data entries
12 entries across 12 versions & 1 rubygems