Sha256: d6a133b72961a3b57edc4c848a2a0b1141ed9ba0ede30afe23e77b85abaacb57
Contents?: true
Size: 593 Bytes
Versions: 11
Compression:
Stored size: 593 Bytes
Contents
# frozen_string_literal: true module Orthoses # Filter current store. # use Orthoses::Filter, # # filter stored key and value if proc return true # if: -> (name, content) { Orthoses.rbs_defined_class?(name) } class Filter def initialize(loader, if:) @loader = loader @if = binding.local_variable_get(:if) end def call @loader.call.tap do |store| store.filter! do |name, content| @if.call(name, content).tap do Orthoses.logger.debug("Filter pass [#{name}]") end end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems