Sha256: f2c97ea5b7c1d3d6dd3fb880b218ad0bf52027e6012bd1e2fe1e3cf11bcdeff0

Contents?: true

Size: 264 Bytes

Versions: 1

Compression:

Stored size: 264 Bytes

Contents

module Alder
  class Rule
    def initialize(fragment, &block)
      @predicate = Predicate.new(fragment)
      @transform = block
    end

    def apply(hash)
      @transform.call(hash) if @predicate.match(hash)
    end

    alias_method :call, :apply
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
alder-0.1.0 lib/alder/rule.rb