Class: ActiveGraph::Migrations::MigrationFile

Inherits:
Object
  • Object
show all
Defined in:
lib/active_graph/migrations/migration_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_name) ⇒ MigrationFile

Returns a new instance of MigrationFile.



6
7
8
9
# File 'lib/active_graph/migrations/migration_file.rb', line 6

def initialize(file_name)
  @file_name = file_name
  extract_data!
end

Instance Attribute Details

#class_nameObject (readonly)

Returns the value of attribute class_name.



4
5
6
# File 'lib/active_graph/migrations/migration_file.rb', line 4

def class_name
  @class_name
end

#file_nameObject (readonly)

Returns the value of attribute file_name.



4
5
6
# File 'lib/active_graph/migrations/migration_file.rb', line 4

def file_name
  @file_name
end

#symbol_nameObject (readonly)

Returns the value of attribute symbol_name.



4
5
6
# File 'lib/active_graph/migrations/migration_file.rb', line 4

def symbol_name
  @symbol_name
end

#versionObject (readonly)

Returns the value of attribute version.



4
5
6
# File 'lib/active_graph/migrations/migration_file.rb', line 4

def version
  @version
end

Instance Method Details

#create(options = {}) ⇒ Object



11
12
13
14
# File 'lib/active_graph/migrations/migration_file.rb', line 11

def create(options = {})
  require @file_name
  class_name.constantize.new(@version, options)
end