Sha256: fd4c2cb8bf46575ec64acf48234fdceebb41239f6301cef3dcba6104ecb8bd89

Contents?: true

Size: 789 Bytes

Versions: 2

Compression:

Stored size: 789 Bytes

Contents

# frozen_string_literal: true

module Nanoc
  module Int
    # @api private
    class OutdatednessRule
      include Nanoc::Core::ContractsSupport
      include Singleton

      def call(obj, outdatedness_checker)
        Nanoc::Int::Instrumentor.call(:outdatedness_rule_ran, self.class) do
          apply(obj, outdatedness_checker)
        end
      end

      def apply(_obj, _outdatedness_checker)
        raise NotImplementedError.new('Nanoc::Int::OutdatednessRule subclasses must implement #apply')
      end

      contract C::None => String
      def inspect
        "#{self.class.name}(#{reason})"
      end

      def self.affects_props(*names)
        @affected_props = Set.new(names)
      end

      def self.affected_props
        @affected_props
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nanoc-4.11.2 lib/nanoc/base/services/outdatedness_rule.rb
nanoc-4.11.1 lib/nanoc/base/services/outdatedness_rule.rb