Class: Pliny::DbSupport::MigrationStatus
- Inherits:
-
Object
- Object
- Pliny::DbSupport::MigrationStatus
- Defined in:
- lib/pliny/db_support.rb
Instance Attribute Summary collapse
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#present_in_database ⇒ Object
Returns the value of attribute present_in_database.
-
#present_on_disk ⇒ Object
Returns the value of attribute present_on_disk.
Instance Method Summary collapse
-
#initialize(filename:) ⇒ MigrationStatus
constructor
A new instance of MigrationStatus.
- #status ⇒ Object
Constructor Details
#initialize(filename:) ⇒ MigrationStatus
Returns a new instance of MigrationStatus.
69 70 71 72 73 |
# File 'lib/pliny/db_support.rb', line 69 def initialize(filename:) @filename = filename @present_on_disk = false @present_in_database = false end |
Instance Attribute Details
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
66 67 68 |
# File 'lib/pliny/db_support.rb', line 66 def filename @filename end |
#present_in_database ⇒ Object
Returns the value of attribute present_in_database.
67 68 69 |
# File 'lib/pliny/db_support.rb', line 67 def present_in_database @present_in_database end |
#present_on_disk ⇒ Object
Returns the value of attribute present_on_disk.
67 68 69 |
# File 'lib/pliny/db_support.rb', line 67 def present_on_disk @present_on_disk end |
Instance Method Details
#status ⇒ Object
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/pliny/db_support.rb', line 75 def status if present_on_disk if present_in_database :up else :down end else if present_in_database :file_missing else raise "error" # FIXME: better message end end end |