class Monotes::BodyText

Constants

FILENAME

Public Class Methods

new(title) click to toggle source
# File lib/monotes/body_text.rb, line 8
def initialize(title)
  @title = title
end

Public Instance Methods

create_issue() click to toggle source
# 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() click to toggle source
# File lib/monotes/body_text.rb, line 16
def flush
  File.delete(path)
end
read() click to toggle source
# File lib/monotes/body_text.rb, line 12
def read
  File.read(path)
end

Private Instance Methods

path() click to toggle source
# File lib/monotes/body_text.rb, line 32
def path
  File.join(app_path, FILENAME)
end