Class: MinceMigrator::Migrations::Loader
- Inherits:
-
Object
- Object
- MinceMigrator::Migrations::Loader
- Defined in:
- lib/mince_migrator/migrations/loader.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(options) ⇒ Loader
constructor
A new instance of Loader.
- #klass ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize(options) ⇒ Loader
Returns a new instance of Loader.
4 5 6 7 |
# File 'lib/mince_migrator/migrations/loader.rb', line 4 def initialize() @klass_name = [:klass_name] @full_path = [:full_path] end |
Instance Method Details
#call ⇒ Object
13 14 15 16 17 18 |
# File 'lib/mince_migrator/migrations/loader.rb', line 13 def call if valid? require @full_path perform_post_load_validations end end |
#klass ⇒ Object
9 10 11 |
# File 'lib/mince_migrator/migrations/loader.rb', line 9 def klass eval "::MinceMigrator::Migrations::#{@klass_name}" end |
#valid? ⇒ Boolean
20 21 22 |
# File 'lib/mince_migrator/migrations/loader.rb', line 20 def valid? file_exists? end |