Class: Wad::File
- Inherits:
-
Object
- Object
- Wad::File
- Defined in:
- lib/wad/file.rb
Overview
A file that is part of a gem.
Instance Attribute Summary collapse
-
#ghem ⇒ Object
readonly
Gem this belongs to.
-
#path ⇒ Object
readonly
Full file path.
-
#to ⇒ Object
readonly
Relative path this file should have after the copy.
Instance Method Summary collapse
- #copy(target) ⇒ Object
- #directory? ⇒ Boolean
- #gem_name ⇒ Object
-
#initialize(ghem, path, to) ⇒ File
constructor
A new instance of File.
Constructor Details
#initialize(ghem, path, to) ⇒ File
Returns a new instance of File.
16 17 18 19 20 |
# File 'lib/wad/file.rb', line 16 def initialize ghem, path, to @ghem = ghem @path = path @to = to end |
Instance Attribute Details
#ghem ⇒ Object (readonly)
Gem this belongs to
14 15 16 |
# File 'lib/wad/file.rb', line 14 def ghem @ghem end |
#path ⇒ Object (readonly)
Full file path
8 9 10 |
# File 'lib/wad/file.rb', line 8 def path @path end |
#to ⇒ Object (readonly)
Relative path this file should have after the copy
11 12 13 |
# File 'lib/wad/file.rb', line 11 def to @to end |
Instance Method Details
#copy(target) ⇒ Object
22 23 24 |
# File 'lib/wad/file.rb', line 22 def copy target target.copy(self) end |
#directory? ⇒ Boolean
30 31 32 |
# File 'lib/wad/file.rb', line 30 def directory? path.directory? end |
#gem_name ⇒ Object
26 27 28 |
# File 'lib/wad/file.rb', line 26 def gem_name ghem.name end |