Class: Monotes::BodyText
- Inherits:
-
Object
- Object
- Monotes::BodyText
- Includes:
- AppDirectory
- Defined in:
- lib/monotes/body_text.rb
Constant Summary collapse
- FILENAME =
"ISSUE_BODY_TEXT"
Instance Method Summary collapse
- #create_issue ⇒ Object
- #flush ⇒ Object
-
#initialize(title) ⇒ BodyText
constructor
A new instance of BodyText.
- #read ⇒ Object
Methods included from AppDirectory
Constructor Details
#initialize(title) ⇒ BodyText
Returns a new instance of BodyText.
8 9 10 |
# File 'lib/monotes/body_text.rb', line 8 def initialize(title) @title = title end |
Instance Method Details
#create_issue ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/monotes/body_text.rb', line 20 def create_issue edit_success = system "vim #{path}" if edit_success body_text = read flush Monotes::Models::Issue.new(:title => @title, :body => body_text) else nil end end |
#flush ⇒ Object
16 17 18 |
# File 'lib/monotes/body_text.rb', line 16 def flush File.delete(path) end |
#read ⇒ Object
12 13 14 |
# File 'lib/monotes/body_text.rb', line 12 def read File.read(path) end |