Class: XMigra::SourceTreeInitializer::ConfigInfo
- Defined in:
- lib/xmigra/source_tree_initializer.rb
Instance Attribute Summary collapse
-
#dbinfo ⇒ Object
readonly
Returns the value of attribute dbinfo.
-
#root_path ⇒ Object
readonly
Returns the value of attribute root_path.
Instance Method Summary collapse
- #after_dbinfo_creation(&blk) ⇒ Object
- #created_file!(fpath) ⇒ Object
- #created_files ⇒ Object
-
#initialize(root_path) ⇒ ConfigInfo
constructor
A new instance of ConfigInfo.
- #run_steps_after_dbinfo_creation! ⇒ Object
Constructor Details
#initialize(root_path) ⇒ ConfigInfo
Returns a new instance of ConfigInfo.
8 9 10 11 12 13 |
# File 'lib/xmigra/source_tree_initializer.rb', line 8 def initialize(root_path) @root_path = Pathname(root_path) @dbinfo = {} @steps_after_dbinfo_creation = [] @created_files = [] end |
Instance Attribute Details
#dbinfo ⇒ Object (readonly)
Returns the value of attribute dbinfo.
15 16 17 |
# File 'lib/xmigra/source_tree_initializer.rb', line 15 def dbinfo @dbinfo end |
#root_path ⇒ Object (readonly)
Returns the value of attribute root_path.
15 16 17 |
# File 'lib/xmigra/source_tree_initializer.rb', line 15 def root_path @root_path end |
Instance Method Details
#after_dbinfo_creation(&blk) ⇒ Object
25 26 27 |
# File 'lib/xmigra/source_tree_initializer.rb', line 25 def after_dbinfo_creation(&blk) @steps_after_dbinfo_creation << blk end |
#created_file!(fpath) ⇒ Object
21 22 23 |
# File 'lib/xmigra/source_tree_initializer.rb', line 21 def created_file!(fpath) @created_files << Pathname(fpath) end |
#created_files ⇒ Object
17 18 19 |
# File 'lib/xmigra/source_tree_initializer.rb', line 17 def created_files @created_files.dup end |
#run_steps_after_dbinfo_creation! ⇒ Object
29 30 31 32 33 |
# File 'lib/xmigra/source_tree_initializer.rb', line 29 def run_steps_after_dbinfo_creation! @steps_after_dbinfo_creation.each do |step| step.call end end |