Sha256: 26e0263853793324419bc43f8937282cf94b1ea1d7051312289cf294e43cb4ce

Contents?: true

Size: 1.29 KB

Versions: 4

Compression:

Stored size: 1.29 KB

Contents

# frozen_string_literal: true

require_relative "object/instance_variable_delete"
require_relative "object/instance_variable_fetch"
require_relative "object/memoize_including_falsy_values"
require_relative "object/resolve_type"

module ConvenientService
  module Utils
    module Object
      class << self
        ##
        # @example
        #   ConvenientService::Utils::Object.instance_variable_delete("abc", :@foo)
        #
        def instance_variable_delete(...)
          InstanceVariableDelete.call(...)
        end

        ##
        # @example
        #   ConvenientService::Utils::Object.instance_variable_fetch("abc", :@foo) { :bar }
        #
        def instance_variable_fetch(...)
          InstanceVariableFetch.call(...)
        end

        ##
        # @example
        #   object = Object.new.tap { |object| object.instance_eval { self.class.attr_reader :foo } }
        #
        #   ConvenientService::Utils::Object.memoize_including_falsy_values(object, :@foo) { false }
        #
        def memoize_including_falsy_values(...)
          MemoizeIncludingFalsyValues.call(...)
        end

        ##
        # @example
        #   ConvenientService::Utils::Object.resolve_type("foo")
        #
        def resolve_type(...)
          ResolveType.call(...)
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
convenient_service-0.11.0 lib/convenient_service/utils/object.rb
convenient_service-0.10.1 lib/convenient_service/utils/object.rb
convenient_service-0.10.0 lib/convenient_service/utils/object.rb
convenient_service-0.9.0 lib/convenient_service/utils/object.rb