class Alder::Rule
Public Class Methods
new(fragment, &block)
click to toggle source
# File lib/alder/rule.rb, line 3 def initialize(fragment, &block) @predicate = Predicate.new(fragment) @transform = block end
Public Instance Methods
apply(hash)
click to toggle source
# File lib/alder/rule.rb, line 8 def apply(hash) @transform.call(hash) if @predicate.match(hash) end
Also aliased as: call