Sha256: 3f45f054e87e5fc1ea3ccacb82ed0c97debfcbaa73cc899b71c8d74cd16fa18a
Contents?: true
Size: 570 Bytes
Versions: 72
Compression:
Stored size: 570 Bytes
Contents
# frozen_string_literal: true module Synvert::Core # Condition checks if rules matches. class Rewriter::Condition # Initialize a condition. # # @param instance [Synvert::Core::Rewriter::Instance] # @param rules [Hash] # @param block [Block] # @return [Synvert::Core::Rewriter::Condition] def initialize(instance, rules, &block) @instance = instance @rules = rules @block = block end # If condition matches, run the block code. def process @instance.instance_eval(&@block) if match? end end end
Version data entries
72 entries across 72 versions & 1 rubygems