Class: Remont::Script
- Inherits:
-
Object
- Object
- Remont::Script
- Defined in:
- lib/remont/script.rb
Instance Method Summary collapse
-
#initialize(path) ⇒ Script
constructor
A new instance of Script.
- #run! ⇒ Object
- #schema ⇒ Remont::Schema
Constructor Details
#initialize(path) ⇒ Script
Returns a new instance of Script.
4 5 6 7 |
# File 'lib/remont/script.rb', line 4 def initialize(path) @path = path @schemas = [] end |
Instance Method Details
#run! ⇒ Object
10 11 12 13 14 |
# File 'lib/remont/script.rb', line 10 def run! instance_eval(File.read(path)) schemas.each(&:process!) end |
#schema ⇒ Remont::Schema
21 22 23 |
# File 'lib/remont/script.rb', line 21 def schema(...) @schemas << Schema.new(...) end |