Class: RubyKpi::Handler

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

Overview

The Handler class

Instance Method Summary collapse

Constructor Details

#initializeHandler

initializer



24
25
26
# File 'lib/ruby_kpi.rb', line 24

def initialize()
  # nothing to do
end

Instance Method Details

#handle(added, removed) ⇒ Object

handle method



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/ruby_kpi.rb', line 29

def handle(added, removed)

  # print added triples
  puts "Added:"
  added.each do |a|
    if a.class == "Triple"
      puts a.to_str()
    else
      puts a.join(", ")
    end
  end
  
  # print removed triples
  puts "Removed:"
  removed.each do |r|
    if r.class == "Triple"
      puts r.to_str()
    else
      puts r.join(", ")
    end
  end

  return

end