Sha256: 942151cabbd9a52f088f8d39b55ff210bfa25e04b4c99dd63d547ea4e4540371

Contents?: true

Size: 496 Bytes

Versions: 66

Compression:

Stored size: 496 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

66 entries across 66 versions & 21 rubygems

Version Path
dguettler-god-0.7.13.2 lib/god/conditions/lambda.rb
dguettler-god-0.7.13.3 lib/god/conditions/lambda.rb
dosire-god-0.7.10 lib/god/conditions/lambda.rb
dosire-god-0.7.12 lib/god/conditions/lambda.rb
dosire-god-0.7.9 lib/god/conditions/lambda.rb
dunedain289-god-0.7.12.1 lib/god/conditions/lambda.rb
dustin-god-0.7.7.1 lib/god/conditions/lambda.rb
eric-god-0.7.10 lib/god/conditions/lambda.rb
eric-god-0.7.11 lib/god/conditions/lambda.rb
eric-god-0.7.12 lib/god/conditions/lambda.rb
eric-god-0.7.14 lib/god/conditions/lambda.rb
eric-god-0.7.7 lib/god/conditions/lambda.rb
fotonauts-god-0.7.10 lib/god/conditions/lambda.rb
fotonauts-god-0.7.12 lib/god/conditions/lambda.rb
gohanlonllc-god-0.7.9 lib/god/conditions/lambda.rb
gordoncww-god-0.7.11.1 lib/god/conditions/lambda.rb
jreynolds-god-0.7.13 lib/god/conditions/lambda.rb
jwilkins-god-0.7.9 lib/god/conditions/lambda.rb
mathieuravaux-god-0.7.11 lib/god/conditions/lambda.rb
mojombo-god-0.7.10 lib/god/conditions/lambda.rb