Class: Sheet::Write
- Inherits:
-
Object
- Object
- Sheet::Write
- Defined in:
- lib/sheet/write.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name = nil) ⇒ Write
constructor
A new instance of Write.
- #write ⇒ Object
Constructor Details
#initialize(name = nil) ⇒ Write
Returns a new instance of Write.
5 6 7 |
# File 'lib/sheet/write.rb', line 5 def initialize(name=nil) @name = name end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/sheet/write.rb', line 3 def name @name end |
Instance Method Details
#write ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/sheet/write.rb', line 9 def write return Sheet.display("Please specify a name") unless name create_dir_if_doesnt_exist if editor_is_set? Sheet.exec("#{Sheet.editor} #{Sheet.sheet_path(name)}", true) else Sheet.display "Please set the $EDITOR variable to write files" end end |