• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

samvera / ldp / 7aae4f98-f021-4aa3-ade3-5b1586e22f3d

19 Aug 2024 06:45PM UTC coverage: 86.165%. Remained the same
7aae4f98-f021-4aa3-ade3-5b1586e22f3d

push

circleci

web-flow
Test with latest ruby and rails versions (#156)

492 of 571 relevant lines covered (86.16%)

38.96 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/lib/ldp/client.rb
1
##
2
# LDP client for presenting an ORM on top of an LDP resource
3
module Ldp
16✔
4
  class Client
16✔
5
    require 'ldp/client/methods'
16✔
6
    require 'ldp/client/prefer_headers'
16✔
7
    include Ldp::Client::Methods
16✔
8

9
    attr_reader :options
16✔
10

11
    def initialize(*args)
16✔
12
      http_client, options = if args.length == 2
246✔
13
                               args
3✔
14
                             elsif args.length == 1 && args.first.is_a?(Faraday::Connection)
243✔
15
                               [args.first, {}]
237✔
16
                             elsif args.length == 1
6✔
17
                               [nil, args.first]
3✔
18
                             else
19
                               raise ArgumentError
3✔
20
                             end
21

22
      @options = options
243✔
23

24
      initialize_http_client(http_client || options)
243✔
25
    end
26

27
    # Find or initialize a new LDP resource by URI
28
    def find_or_initialize(subject, options = {})
16✔
29
      data = get(subject, options)
24✔
30

31
      Ldp::Resource.for(self, subject, data)
24✔
32
    end
33

34
    def logger
16✔
35
      Ldp.logger
3✔
36
    end
37
  end
38
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc