Sha256: a28ed725a4ef93bf77879ede093de3bada631113d64e81f4c1ea7c19b95957f2

Contents?: true

Size: 707 Bytes

Versions: 81

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

81 entries across 81 versions & 1 rubygems

Version Path
alula-ruby-2.6.1 lib/alula/singleton_rest_resource.rb
alula-ruby-2.6.0 lib/alula/singleton_rest_resource.rb
alula-ruby-2.5.0 lib/alula/singleton_rest_resource.rb
alula-ruby-2.4.0 lib/alula/singleton_rest_resource.rb
alula-ruby-2.3.0 lib/alula/singleton_rest_resource.rb
alula-ruby-2.2.0 lib/alula/singleton_rest_resource.rb
alula-ruby-2.1.2 lib/alula/singleton_rest_resource.rb
alula-ruby-2.1.1 lib/alula/singleton_rest_resource.rb
alula-ruby-2.1.0 lib/alula/singleton_rest_resource.rb
alula-ruby-2.0.0 lib/alula/singleton_rest_resource.rb
alula-ruby-1.10.5 lib/alula/singleton_rest_resource.rb
alula-ruby-1.10.4 lib/alula/singleton_rest_resource.rb
alula-ruby-1.10.3 lib/alula/singleton_rest_resource.rb
alula-ruby-1.10.2 lib/alula/singleton_rest_resource.rb
alula-ruby-1.10.1 lib/alula/singleton_rest_resource.rb
alula-ruby-1.10.0 lib/alula/singleton_rest_resource.rb
alula-ruby-1.9.17 lib/alula/singleton_rest_resource.rb
alula-ruby-1.9.16 lib/alula/singleton_rest_resource.rb
alula-ruby-1.9.15 lib/alula/singleton_rest_resource.rb
alula-ruby-1.9.14 lib/alula/singleton_rest_resource.rb