Sha256: ee192d1b34060dbe9d9ea48344b68b021397548a27ba0f8d0fd4e5d248f363b1
Contents?: true
Size: 747 Bytes
Versions: 16
Compression:
Stored size: 747 Bytes
Contents
module DomoscioRails # @abstract class Resource class << self def class_name name.split('::')[-1] end def url(id = nil, util_name = nil, on_self = nil ) if self == Resource raise NotImplementedError.new('Resource is an abstract class. Do not use it directly.') end build_url = "/v#{DomoscioRails.configuration.version}/instances/#{DomoscioRails.configuration.client_id}" if !on_self build_url << "/#{class_name.underscore}s" if util_name build_url << "/#{util_name}" end if id build_url << "/#{CGI.escape(id.to_s)}" end end return build_url end end end end
Version data entries
16 entries across 16 versions & 1 rubygems