Sha256: 6804e953463ea2461c947791831f7105443112d9d3da561ee356e40d6186b2e1

Contents?: true

Size: 383 Bytes

Versions: 3

Compression:

Stored size: 383 Bytes

Contents

module Eligible
  class APIResource < EligibleObject

    def self.class_name
      self.name.split('::')[-1]
    end

    def self.url()
      if self == APIResource
        raise NotImplementedError.new('APIResource is an abstract class.  You should perform actions on its subclasses (Plan, Service, etc.)')
      end
      "/#{CGI.escape(class_name.downcase)}/"
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
eligible-2.4.3 lib/eligible/api_resource.rb
eligible-2.4.2 lib/eligible/api_resource.rb
eligible-2.4.1 lib/eligible/api_resource.rb