Sha256: 53a65d848b2c0ced42f7599bfc1a27a96aaffcc9ff26ee5e393983489c767634
Contents?: true
Size: 1 KB
Versions: 6
Compression:
Stored size: 1 KB
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
6 entries across 6 versions & 1 rubygems
Version | Path |
---|---|
ldp-1.2.1 | lib/ldp/client.rb |
ldp-1.2.0 | lib/ldp/client.rb |
ldp-1.1.0 | lib/ldp/client.rb |
ldp-1.0.3 | lib/ldp/client.rb |
ldp-1.0.2 | lib/ldp/client.rb |
ldp-1.0.1 | lib/ldp/client.rb |