Class: PointRb::Directory
- Inherits:
-
Object
- Object
- PointRb::Directory
- Defined in:
- lib/pointrb/directory.rb
Instance Attribute Summary collapse
-
#base_dir ⇒ Object
Returns the value of attribute base_dir.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
- #create ⇒ Object
- #full_path ⇒ Object
-
#initialize(path, base_dir = "") ⇒ Directory
constructor
A new instance of Directory.
Constructor Details
#initialize(path, base_dir = "") ⇒ Directory
Returns a new instance of Directory.
8 9 10 11 |
# File 'lib/pointrb/directory.rb', line 8 def initialize(path,base_dir="") @path = path @base_dir = base_dir end |
Instance Attribute Details
#base_dir ⇒ Object
Returns the value of attribute base_dir.
6 7 8 |
# File 'lib/pointrb/directory.rb', line 6 def base_dir @base_dir end |
#path ⇒ Object
Returns the value of attribute path.
6 7 8 |
# File 'lib/pointrb/directory.rb', line 6 def path @path end |
Instance Method Details
#create ⇒ Object
21 22 23 |
# File 'lib/pointrb/directory.rb', line 21 def create FileUtils.mkdir_p full_path end |
#full_path ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/pointrb/directory.rb', line 13 def full_path if @path =~ /^\// @path else File.join(@base_dir, @path) end end |