Sha256: a28ed725a4ef93bf77879ede093de3bada631113d64e81f4c1ea7c19b95957f2
Contents?: true
Size: 707 Bytes
Versions: 83
Compression:
Stored size: 707 Bytes
Contents
module Alula class SingletonRestResource < ApiResource def self.resource_url if self == SingletonRestResource raise NotImplementedError, "SingletonRestResource is an abstract class. You should perform actions on its subclasses (Self, etc.)" end # Namespaces are separated in object names with periods (.) and in URLs # with forward slashes (/), so replace the former with the latter. "/rest/v1/#{self.get_resource_path}" end def resource_url self.class.resource_url end def self.retrieve instance = new instance.refresh instance end def initialize(attributes = {}) super(nil, attributes) end end end
Version data entries
83 entries across 83 versions & 1 rubygems