Class: Rmk::VOutDir
- Inherits:
-
Hash
- Object
- Hash
- Rmk::VOutDir
- Defined in:
- lib/rmk/vdir.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#vpath ⇒ Object
readonly
Returns the value of attribute vpath.
Instance Method Summary collapse
- #derive_new(subname) ⇒ Object
-
#initialize(path:, vpath: nil) ⇒ VOutDir
constructor
A new instance of VOutDir.
- #join_abs_path(path) ⇒ Object
- #join_virtual_path(path) ⇒ Object
- #new_filepath(name) ⇒ Object
Constructor Details
#initialize(path:, vpath: nil) ⇒ VOutDir
Returns a new instance of VOutDir.
9 10 11 12 |
# File 'lib/rmk/vdir.rb', line 9 def initialize(path:, vpath:nil) super() @path, @vpath = path, vpath end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
7 8 9 |
# File 'lib/rmk/vdir.rb', line 7 def path @path end |
#vpath ⇒ Object (readonly)
Returns the value of attribute vpath.
7 8 9 |
# File 'lib/rmk/vdir.rb', line 7 def vpath @vpath end |
Instance Method Details
#derive_new(subname) ⇒ Object
14 15 16 |
# File 'lib/rmk/vdir.rb', line 14 def derive_new(subname) Rmk::VOutDir.new path:File.join(@path, subname, ''), vpath:@vpath && File.join(@vpath, subname, '') end |
#join_abs_path(path) ⇒ Object
18 |
# File 'lib/rmk/vdir.rb', line 18 def join_abs_path(path) File.join @path, path end |
#join_virtual_path(path) ⇒ Object
20 |
# File 'lib/rmk/vdir.rb', line 20 def join_virtual_path(path) @vpath && File.join(@vpath, path) end |
#new_filepath(name) ⇒ Object
22 23 24 |
# File 'lib/rmk/vdir.rb', line 22 def new_filepath(name) {path:File.join(@path, name), vpath:@vpath && (@vpath.empty? ? name : File.join(@vpath, name))} end |