Sha256: da6933c81c3a0705aca542887d5f0803c84e5bd414ea176f814ddbe5ec62078e
Contents?: true
Size: 841 Bytes
Versions: 10
Compression:
Stored size: 841 Bytes
Contents
## # LDP client for presenting an ORM on top of an LDP resource module Ldp class Client require 'ldp/client/methods' require 'ldp/client/prefer_headers' include Ldp::Client::Methods attr_reader :options def initialize(*args) http_client, options = if args.length == 2 args elsif args.length == 1 && args.first.is_a?(Faraday::Connection) [args.first, {}] elsif args.length == 1 [nil, args.first] else raise ArgumentError end @options = options initialize_http_client(http_client || options) end # Find or initialize a new LDP resource by URI def find_or_initialize(subject, options = {}) data = get(subject, options) Ldp::Resource.for(self, subject, data) end def logger Ldp.logger end end end
Version data entries
10 entries across 10 versions & 1 rubygems