anjlab/triggerable

View on GitHub
lib/triggerable/conditions/method_condition.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Triggerable
  module Conditions
    class MethodCondition < Condition
      def initialize method_name
        @method_name = method_name
      end

      def true_for? object
        object.send(@method_name)
      end

      def desc
        @method_name
      end
    end
  end
end