Module: DataImp::Dir
- Included in:
- DataImp
- Defined in:
- lib/data_imp/dir.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.extended(mod) ⇒ Object
3 4 5 |
# File 'lib/data_imp/dir.rb', line 3 def self.extended(mod) mod.delegate :data_dir, to: :class end |
Instance Method Details
#data_dir ⇒ Object
25 26 27 |
# File 'lib/data_imp/dir.rb', line 25 def data_dir @data_dir ||= root.join('data') end |
#data_dir=(dir) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/data_imp/dir.rb', line 15 def data_dir= dir path = Pathname.new(dir) @data_dir = if path.absolute? path else root.join(path) end end |
#root ⇒ Object
11 12 13 |
# File 'lib/data_imp/dir.rb', line 11 def root @root ||= Pathname.pwd end |
#root=(dir) ⇒ Object
7 8 9 |
# File 'lib/data_imp/dir.rb', line 7 def root= dir @root = dir end |