Class: AspenFile
- Inherits:
-
Object
- Object
- AspenFile
- Defined in:
- lib/aspen_file.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#direc ⇒ Object
readonly
Returns the value of attribute direc.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#templ ⇒ Object
readonly
Returns the value of attribute templ.
Class Method Summary collapse
Instance Method Summary collapse
- #create(root) ⇒ Object
-
#initialize(templ, direc, file) ⇒ AspenFile
constructor
A new instance of AspenFile.
Constructor Details
#initialize(templ, direc, file) ⇒ AspenFile
Returns a new instance of AspenFile.
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/aspen_file.rb', line 13 def initialize(templ, direc, file) @templ = templ if direc.length != 0 @direc = direc + "/" else @direc = "" end @file = file @@all << self end |
Instance Attribute Details
#direc ⇒ Object (readonly)
Returns the value of attribute direc.
5 6 7 |
# File 'lib/aspen_file.rb', line 5 def direc @direc end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
5 6 7 |
# File 'lib/aspen_file.rb', line 5 def file @file end |
#templ ⇒ Object (readonly)
Returns the value of attribute templ.
5 6 7 |
# File 'lib/aspen_file.rb', line 5 def templ @templ end |
Class Method Details
.all ⇒ Object
9 10 11 |
# File 'lib/aspen_file.rb', line 9 def self.all @@all end |
Instance Method Details
#create(root) ⇒ Object
24 25 26 27 |
# File 'lib/aspen_file.rb', line 24 def create(root) FileUtils.cp("#{self.templ}/#{self.file[0]}", "#{root}#{self.direc}#{self.file[0]}") puts " create #{self.direc}#{self.file[0]}" end |