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.
71 72 73 74 75 |
# File 'lib/pliny/db_support.rb', line 71 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.
68 69 70 |
# File 'lib/pliny/db_support.rb', line 68 def filename @filename end |
#present_in_database ⇒ Object
Returns the value of attribute present_in_database.
69 70 71 |
# File 'lib/pliny/db_support.rb', line 69 def present_in_database @present_in_database end |
#present_on_disk ⇒ Object
Returns the value of attribute present_on_disk.
69 70 71 |
# File 'lib/pliny/db_support.rb', line 69 def present_on_disk @present_on_disk end |
Instance Method Details
#status ⇒ Object
77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/pliny/db_support.rb', line 77 def status if present_on_disk if present_in_database :up else :down end elsif present_in_database :file_missing else raise "error" # FIXME: better message end end |