Sha256: c7525ea89aca4e5607a97c851b2833a31b3f2eb6540c85182ea5413c1c2e78da
Contents?: true
Size: 905 Bytes
Versions: 8
Compression:
Stored size: 905 Bytes
Contents
require "omise/object" require "omise/list" require "omise/charge_list" require "omise/search_scope" module Omise class Link < OmiseObject self.endpoint = "/links" def self.search SearchScope.new(:link) end def self.retrieve(id, attributes = {}) new resource(location(id), attributes).get(attributes) end def self.list(attributes = {}) List.new resource(location, attributes).get(attributes) end def self.create(attributes = {}) new resource(location, attributes).post(attributes) end def reload(attributes = {}) assign_attributes resource(attributes).get(attributes) end def charges(options = {}) if options.empty? list_attribute ChargeList, "charges" else response = collection.resource(location("charges")).get(options) ChargeList.new(self, response) end end end end
Version data entries
8 entries across 8 versions & 1 rubygems