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

ruby-grape / grape / 13501493749

24 Feb 2025 03:21PM UTC coverage: 98.389% (+0.02%) from 98.367%
13501493749

Pull #2538

github

web-flow
Merge ab35c7e0b into 6e6958f35
Pull Request #2538: Handle json array

7 of 7 new or added lines in 2 files covered. (100.0%)

4 existing lines in 3 files now uncovered.

3542 of 3600 relevant lines covered (98.39%)

76444.42 hits per line

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

76.19
/lib/grape/util/lazy/object.rb
1
# frozen_string_literal: true
2

3
# Based on https://github.com/HornsAndHooves/lazy_object
4

5
module Grape
60✔
6
  module Util
60✔
7
    module Lazy
60✔
8
      class Object < BasicObject
60✔
9
        attr_reader :callable
60✔
10

11
        def initialize(&callable)
60✔
12
          @callable = callable
60✔
13
        end
14

15
        def __target_object__
60✔
16
          @__target_object__ ||= callable.call
1,882✔
17
        end
18

19
        def ==(other)
60✔
UNCOV
20
          __target_object__ == other
×
21
        end
22

23
        def !=(other)
60✔
24
          __target_object__ != other
×
25
        end
26

27
        def !
60✔
28
          !__target_object__
×
29
        end
30

31
        def method_missing(method_name, *args, &block)
60✔
32
          if __target_object__.respond_to?(method_name)
941✔
33
            __target_object__.send(method_name, *args, &block)
941✔
34
          else
35
            super
×
36
          end
37
        end
38

39
        def respond_to_missing?(method_name, include_priv = false)
60✔
40
          __target_object__.respond_to?(method_name, include_priv)
×
41
        end
42
      end
43
    end
44
  end
45
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