Class: Neo4j::Generators::ActiveModel

Inherits:
Rails::Generators::ActiveModel
  • Object
show all
Defined in:
lib/rails/generators/neo4j_generator.rb

Overview

:nodoc:

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.all(klass) ⇒ Object


69
70
71
# File 'lib/rails/generators/neo4j_generator.rb', line 69

def self.all(klass)
  "#{klass}.all"
end

.build(klass, params = nil) ⇒ Object


77
78
79
80
81
82
83
# File 'lib/rails/generators/neo4j_generator.rb', line 77

def self.build(klass, params = nil)
  if params
    "#{klass}.new(#{params})"
  else
    "#{klass}.new"
  end
end

.find(klass, params = nil) ⇒ Object


73
74
75
# File 'lib/rails/generators/neo4j_generator.rb', line 73

def self.find(klass, params = nil)
  "#{klass}.find(#{params})"
end

Instance Method Details

#destroyObject


97
98
99
# File 'lib/rails/generators/neo4j_generator.rb', line 97

def destroy
  "#{name}.destroy"
end

#errorsObject


93
94
95
# File 'lib/rails/generators/neo4j_generator.rb', line 93

def errors
  "#{name}.errors"
end

#saveObject


85
86
87
# File 'lib/rails/generators/neo4j_generator.rb', line 85

def save
  "#{name}.save"
end

#update_attributes(params = nil) ⇒ Object


89
90
91
# File 'lib/rails/generators/neo4j_generator.rb', line 89

def update_attributes(params = nil)
  "#{name}.update_attributes(#{params})"
end