Sha256: 84f9262c37ab19c0f80b6701ac8a8a52b6d05d771639ff7335308034278c5ffd
Contents?: true
Size: 803 Bytes
Versions: 39
Compression:
Stored size: 803 Bytes
Contents
module Arrest # A resource that does not maintain a collection of object # but a single object. class SingleResource < RootResource class << self def load(context) r = source().get_one(context, "#{self.resource_path}") body = body_root(r) if body == nil || body.empty? Arrest::logger.info "DocumentNotFoundError for #{self.resource_path}" raise Errors::DocumentNotFoundError.new end self.build(context, body) end def find(context, id) raise "A find is not possible for a SingleResource" end end # the single resource does not use an id to identify the object # since it's already identified by the reource path def resource_location self.class.resource_path end end end
Version data entries
39 entries across 39 versions & 1 rubygems