Class: FactsDatabase

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

Overview

Adapter for facts database.

Instance Method Summary collapse

Constructor Details

#initializeFactsDatabase

Returns a new instance of FactsDatabase.



26
27
28
# File 'lib/cirrocumulus/facts.rb', line 26

def initialize
	@storage = []
end

Instance Method Details

#add(fact, options = {}) ⇒ Object



30
31
32
# File 'lib/cirrocumulus/facts.rb', line 30

def add(fact, options = {})
	@storage << Fact.new(fact, Time.now, options)
end

#enumerateObject



38
39
40
# File 'lib/cirrocumulus/facts.rb', line 38

def enumerate
	@storage.dup
end

#remove(fact) ⇒ Object



34
35
36
# File 'lib/cirrocumulus/facts.rb', line 34

def remove(fact)
	@storage.delete_if {|f| f.data == fact}
end