Class: Scrappy::Repository

Inherits:
RDF::Repository
  • Object
show all
Defined in:
lib/scrappy/repository.rb

Instance Method Summary collapse

Instance Method Details

#recent_contexts(uri, seconds = @options[:time].to_i*60) ⇒ Object

Processes the list of context, checks if there is any extraction from the last X minutes, and returns an array with them. If there is not any extraction, returns an empty array



6
7
8
9
10
11
12
# File 'lib/scrappy/repository.rb', line 6

def recent_contexts uri, seconds=@options[:time].to_i*60
  return [] unless uri
  contexts.select do |context|
    date = context_date(context)
    date and check_date(date, seconds) and context_uri(context) == uri
  end
end

#timeObject



14
15
16
# File 'lib/scrappy/repository.rb', line 14

def time
  @options[:time]
end