Class: Brutal::File::Write
- Inherits:
-
Object
- Object
- Brutal::File::Write
- Defined in:
- lib/brutal/file/write.rb
Overview
Brutal::File::Write
Instance Attribute Summary collapse
- #name ⇒ Object readonly
Instance Method Summary collapse
- #call(scaffold) ⇒ Object
-
#initialize(name) ⇒ Write
constructor
A new instance of Write.
Constructor Details
#initialize(name) ⇒ Write
Returns a new instance of Write.
11 12 13 |
# File 'lib/brutal/file/write.rb', line 11 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
9 10 11 |
# File 'lib/brutal/file/write.rb', line 9 def name @name end |
Instance Method Details
#call(scaffold) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/brutal/file/write.rb', line 15 def call(scaffold) file = ::File.open(path, "w") file.write(scaffold) true ensure file.close end |