class Neo4j::Schema::Operation
Attributes
label_name[R]
options[R]
property[R]
Public Class Methods
incompatible_operation_classes()
click to toggle source
# File lib/neo4j/schema/operation.rb 12 def self.incompatible_operation_classes 13 [] 14 end
new(label_name, property, options = default_options)
click to toggle source
# File lib/neo4j/schema/operation.rb 6 def initialize(label_name, property, options = default_options) 7 @label_name = label_name.to_sym 8 @property = property.to_sym 9 @options = options 10 end
Public Instance Methods
create!()
click to toggle source
# File lib/neo4j/schema/operation.rb 16 def create! 17 drop_incompatible! 18 return if exist? 19 label_object.send(:"create_#{type}", property, options) 20 end
default_options()
click to toggle source
# File lib/neo4j/schema/operation.rb 45 def default_options 46 {} 47 end
drop!()
click to toggle source
# File lib/neo4j/schema/operation.rb 30 def drop! 31 label_object.send(:"drop_#{type}", property, options) 32 end
drop_incompatible!()
click to toggle source
# File lib/neo4j/schema/operation.rb 34 def drop_incompatible! 35 incompatible_operation_classes.each do |clazz| 36 operation = clazz.new(label_name, property) 37 operation.drop! if operation.exist? 38 end 39 end
exist?()
click to toggle source
# File lib/neo4j/schema/operation.rb 41 def exist? 42 fail 'Abstract class, not implemented' 43 end
incompatible_operation_classes()
click to toggle source
# File lib/neo4j/schema/operation.rb 26 def incompatible_operation_classes 27 self.class.incompatible_operation_classes 28 end
label_object()
click to toggle source
# File lib/neo4j/schema/operation.rb 22 def label_object 23 @label_object ||= Neo4j::Label.create(label_name) 24 end
type()
click to toggle source
# File lib/neo4j/schema/operation.rb 49 def type 50 fail 'Abstract class, not implemented' 51 end