Class: RuleEngine::Fact

Inherits:
Object
  • Object
show all
Defined in:
lib/cirrocumulus/rules/engine.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, time, options) ⇒ Fact

Returns a new instance of Fact.



21
22
23
24
25
# File 'lib/cirrocumulus/rules/engine.rb', line 21

def initialize(data, time, options)
  @data = data
  @time = time
  @options = options
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



27
28
29
# File 'lib/cirrocumulus/rules/engine.rb', line 27

def data
  @data
end

#is_deletedObject

Returns the value of attribute is_deleted.



28
29
30
# File 'lib/cirrocumulus/rules/engine.rb', line 28

def is_deleted
  @is_deleted
end

Instance Method Details

#timed_out?Boolean

Returns:

  • (Boolean)


30
31
32
33
# File 'lib/cirrocumulus/rules/engine.rb', line 30

def timed_out?
  return false if @options[:expires] == nil
  @time + @options[:expires] < Time.now
end