Sha256: 4cfa716fe8fe442324b3b9a44fb5e64f31820b165dc63cb19318bba1bd82d4d0

Contents?: true

Size: 493 Bytes

Versions: 12

Compression:

Stored size: 493 Bytes

Contents

module God
  module Conditions

    class Lambda < PollCondition
      attr_accessor :lambda

      def valid?
        valid = true
        valid &= complain("Attribute 'lambda' must be specified", self) if self.lambda.nil?
        valid
      end

      def test
        if self.lambda.call()
          self.info = "lambda condition was satisfied"
          true
        else
          self.info = "lambda condition was not satisfied"
          false
        end
      end
    end

  end
end

Version data entries

12 entries across 12 versions & 3 rubygems

Version Path
resurrected_god-0.14.0 lib/god/conditions/lambda.rb
mcproc-2016.2.20 lib/god/conditions/lambda.rb
god-0.13.7 lib/god/conditions/lambda.rb
god-0.13.6 lib/god/conditions/lambda.rb
god-0.13.5 lib/god/conditions/lambda.rb
god-0.13.4 lib/god/conditions/lambda.rb
god-0.13.3 lib/god/conditions/lambda.rb
god-0.13.2 lib/god/conditions/lambda.rb
god-0.13.1 lib/god/conditions/lambda.rb
god-0.13.0 lib/god/conditions/lambda.rb
god-0.12.1 lib/god/conditions/lambda.rb
god-0.12.0 lib/god/conditions/lambda.rb