Class: CaTissue::Delta

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/catissue/extract/delta.rb

Overview

Delta determines caTissue objects which changed within a time interval.

Instance Method Summary collapse

Constructor Details

#initialize(target, since, before = nil) ⇒ Delta

Creates a new Delta for objects of the given target type which changed at or after the since Date and earlier but not at the before Date. The default before Date is now.



16
17
18
19
20
21
# File 'lib/catissue/extract/delta.rb', line 16

def initialize(target, since, before=nil)
  # convert the required target to a CaTissue class if necessary
  @matcher = create_table_regex(target)
  @since = since
  @before = before || DateTime.now
end

Instance Method Details

#each(&block) ⇒ Object

Calls the given block on each caTissue identifier satisfying the delta condition. This method submits the delta SQL and filters the result on the target class. This method always submits the query; the caller is responsible for preserving the result if necessary using #to_a.



27
28
29
# File 'lib/catissue/extract/delta.rb', line 27

def each(&block)
  execute_query(&block)
end