Class: ContentfulMigrations::MigrationProxy

Inherits:
Struct
  • Object
show all
Extended by:
Forwardable
Includes:
Utils
Defined in:
lib/contentful_migrations/migration_proxy.rb

Overview

MigrationProxy is used to defer loading of the actual migration classes until they are needed. This implementation is borrowed from activerecord’s migration library.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils

#camelize, #constantize

Constructor Details

#initialize(name, version, filename, scope) ⇒ MigrationProxy

Returns a new instance of MigrationProxy.



13
14
15
16
# File 'lib/contentful_migrations/migration_proxy.rb', line 13

def initialize(name, version, filename, scope)
  super
  @migration = nil
end

Instance Attribute Details

#filenameObject

Returns the value of attribute filename

Returns:

  • (Object)

    the current value of filename



9
10
11
# File 'lib/contentful_migrations/migration_proxy.rb', line 9

def filename
  @filename
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



9
10
11
# File 'lib/contentful_migrations/migration_proxy.rb', line 9

def name
  @name
end

#scopeObject

Returns the value of attribute scope

Returns:

  • (Object)

    the current value of scope



9
10
11
# File 'lib/contentful_migrations/migration_proxy.rb', line 9

def scope
  @scope
end

#versionObject

Returns the value of attribute version

Returns:

  • (Object)

    the current value of version



9
10
11
# File 'lib/contentful_migrations/migration_proxy.rb', line 9

def version
  @version
end

Instance Method Details

#basenameObject



18
19
20
# File 'lib/contentful_migrations/migration_proxy.rb', line 18

def basename
  File.basename(filename)
end