Class: Graphable::NodeCreator

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/graphable/node_creator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(klass) ⇒ NodeCreator

Returns a new instance of NodeCreator.



10
11
12
# File 'lib/graphable/node_creator.rb', line 10

def initialize(klass)
  @klass = klass
end

Instance Attribute Details

#klassObject (readonly)

Returns the value of attribute klass.



7
8
9
# File 'lib/graphable/node_creator.rb', line 7

def klass
  @klass
end

Instance Method Details

#callObject



14
15
16
17
18
19
20
21
# File 'lib/graphable/node_creator.rb', line 14

def call 
  puts "Building nodes for #{name}"
  all.each_slice(100) do |slice|
    slice.each do |object|
      Graphable.index_cache[object] = Neography::Node.create(object.to_node) 
    end
  end
end