Class: XMigra::SourceTreeInitializer::ConfigInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/xmigra/source_tree_initializer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dbinfoObject (readonly)

Returns the value of attribute dbinfo.



15
16
17
# File 'lib/xmigra/source_tree_initializer.rb', line 15

def dbinfo
  @dbinfo
end

#root_pathObject (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_filesObject



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