Class: Cirrocumulus::Ruler::Fact
- Inherits:
-
Object
- Object
- Cirrocumulus::Ruler::Fact
- Defined in:
- lib/cirrocumulus/rules/fact.rb
Overview
Fact. Piece of information, collected and operated in Cirrocumulus. We also remember the time, when this fact was created (observed). Optionally can have expiration time
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#is_deleted ⇒ Object
Returns the value of attribute is_deleted.
Instance Method Summary collapse
- #expired? ⇒ Boolean
-
#initialize(data, time, options) ⇒ Fact
constructor
A new instance of Fact.
Constructor Details
#initialize(data, time, options) ⇒ Fact
Returns a new instance of Fact.
10 11 12 13 14 |
# File 'lib/cirrocumulus/rules/fact.rb', line 10 def initialize(data, time, ) @data = data @time = time @options = end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
7 8 9 |
# File 'lib/cirrocumulus/rules/fact.rb', line 7 def data @data end |
#is_deleted ⇒ Object
Returns the value of attribute is_deleted.
8 9 10 |
# File 'lib/cirrocumulus/rules/fact.rb', line 8 def is_deleted @is_deleted end |
Instance Method Details
#expired? ⇒ Boolean
16 17 18 19 |
# File 'lib/cirrocumulus/rules/fact.rb', line 16 def expired? return false if @options[:expires] == nil @time + @options[:expires] < Time.now end |