class CamTool::VertexCounter

Attributes

map[R]

Public Class Methods

new() click to toggle source
# File lib/camtool/vertex_counter.rb, line 5
def initialize
  @map = Hash.new(0)
end

Public Instance Methods

activity(k, v) click to toggle source
# File lib/camtool/vertex_counter.rb, line 17
def activity k, v
  self.add v['prov:type']
end
add(key) click to toggle source
# File lib/camtool/vertex_counter.rb, line 9
def add key
  @map[key]=@map[key]+1
end
agent(k, v) click to toggle source
# File lib/camtool/vertex_counter.rb, line 21
def agent k, v
  self.add v['prov:type']
end
entity(k, v) click to toggle source
# File lib/camtool/vertex_counter.rb, line 13
def entity k, v
  self.add v['prov:type']
end
show() click to toggle source
# File lib/camtool/vertex_counter.rb, line 25
def show
  puts "\n\n-------------\nVertex types\n-------------\n"
  @map = @map.sort_by { |key, value| value }.reverse
  @map.each do |key, value|
    puts "#{key}:#{value}"
  end
end