Class: Fancybox2::Migrations::Base
- Inherits:
-
Object
- Object
- Fancybox2::Migrations::Base
- Defined in:
- lib/fancybox2/migrations/base.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Class Method Summary collapse
Instance Method Summary collapse
- #call(up_or_down = :up) ⇒ Object
-
#initialize(name) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(name) ⇒ Base
Returns a new instance of Base.
13 14 15 16 17 |
# File 'lib/fancybox2/migrations/base.rb', line 13 def initialize(name) @name = name @version = Runner.extract_and_validate_version_from name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
11 12 13 |
# File 'lib/fancybox2/migrations/base.rb', line 11 def name @name end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
11 12 13 |
# File 'lib/fancybox2/migrations/base.rb', line 11 def version @version end |
Class Method Details
.descendants ⇒ Object
6 7 8 |
# File 'lib/fancybox2/migrations/base.rb', line 6 def self.descendants ObjectSpace.each_object(Class).select { |klass| klass < self } end |
Instance Method Details
#call(up_or_down = :up) ⇒ Object
19 20 21 |
# File 'lib/fancybox2/migrations/base.rb', line 19 def call(up_or_down = :up) send up_or_down end |