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

Code-Vedas / mutils / 12468956720

23 Dec 2024 03:14PM CUT coverage: 100.0%. Remained the same
12468956720

push

github

web-flow
build(deps): bump json from 2.8.2 to 2.9.1 (#315)

Bumps [json](https://github.com/ruby/json) from 2.8.2 to 2.9.1.
- [Release notes](https://github.com/ruby/json/releases)
- [Changelog](https://github.com/ruby/json/blob/master/CHANGES.md)
- [Commits](https://github.com/ruby/json/compare/v2.8.2...v2.9.1)

---
updated-dependencies:
- dependency-name: json
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

205 of 205 relevant lines covered (100.0%)

56736.31 hits per line

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

100.0
/lib/mutils/lib/helper.rb
1
# frozen_string_literal: true
2

3
require 'singleton'
4✔
4
# module Mutils
5
module Mutils
4✔
6
  module Lib
4✔
7
    # Helper: caching expensive repetitive operations
8
    class Helper
4✔
9
      include Singleton
4✔
10

11
      def initialize
4✔
12
        self.inflector_object = Dry::Inflector.new
4✔
13
        self.pluralize_cache = {}
4✔
14
        self.underscore_cache = {}
4✔
15
        self.constantize_cache = {}
4✔
16
      end
17

18
      def underscore(string)
4✔
19
        underscore_cache[string] = inflector_object.underscore string unless underscore_cache[string]
20✔
20
        underscore_cache[string]
20✔
21
      end
22

23
      def pluralize(string)
4✔
24
        pluralize_cache[string] = inflector_object.pluralize string unless pluralize_cache[string]
116✔
25
        pluralize_cache[string]
116✔
26
      end
27

28
      def constantize(string)
4✔
29
        constantize_cache[string] = Object.const_get string unless constantize_cache[string]
192✔
30
        constantize_cache[string]
188✔
31
      end
32

33
      def collection?(object)
4✔
34
        object.respond_to?(:size) && !object.respond_to?(:each_pair)
352,796✔
35
      end
36

37
      private
4✔
38

39
      attr_accessor :inflector_object, :pluralize_cache, :underscore_cache, :constantize_cache
4✔
40
    end
41
  end
42
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