Class: Rmk::VOutDir

Inherits:
Hash
  • Object
show all
Defined in:
lib/rmk/vdir.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#pathObject (readonly)

Returns the value of attribute path.



7
8
9
# File 'lib/rmk/vdir.rb', line 7

def path
  @path
end

#vpathObject (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