Class: RailsCopier::Folder
- Inherits:
-
Object
- Object
- RailsCopier::Folder
- Defined in:
- lib/rails_copier/folder.rb
Instance Attribute Summary collapse
-
#from ⇒ Object
Returns the value of attribute from.
-
#new_dir ⇒ Object
Returns the value of attribute new_dir.
-
#new_name ⇒ Object
Returns the value of attribute new_name.
-
#to ⇒ Object
Returns the value of attribute to.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(from, to, new_name) ⇒ Folder
constructor
A new instance of Folder.
- #path_to_secrets ⇒ Object
- #save ⇒ Object
Constructor Details
#initialize(from, to, new_name) ⇒ Folder
Returns a new instance of Folder.
9 10 11 12 13 |
# File 'lib/rails_copier/folder.rb', line 9 def initialize(from, to, new_name) @new_name = new_name @from = from @to = to end |
Instance Attribute Details
#from ⇒ Object
Returns the value of attribute from.
3 4 5 |
# File 'lib/rails_copier/folder.rb', line 3 def from @from end |
#new_dir ⇒ Object
Returns the value of attribute new_dir.
3 4 5 |
# File 'lib/rails_copier/folder.rb', line 3 def new_dir @new_dir end |
#new_name ⇒ Object
Returns the value of attribute new_name.
3 4 5 |
# File 'lib/rails_copier/folder.rb', line 3 def new_name @new_name end |
#to ⇒ Object
Returns the value of attribute to.
3 4 5 |
# File 'lib/rails_copier/folder.rb', line 3 def to @to end |
Class Method Details
.create(from, to, new_name) ⇒ Object
5 6 7 |
# File 'lib/rails_copier/folder.rb', line 5 def self.create(from, to, new_name) new(from, to, new_name).save end |
Instance Method Details
#path_to_secrets ⇒ Object
20 21 22 |
# File 'lib/rails_copier/folder.rb', line 20 def path_to_secrets "#{new_dir}/config/secrets.yml" end |
#save ⇒ Object
15 16 17 18 |
# File 'lib/rails_copier/folder.rb', line 15 def save @new_dir = FileUtils::mkdir_p("#{to}/#{new_name.underscore}").join self end |