Sha256: c2d11284e08e384d7f06e91c94ba721ae2207d7a2d6fa844385e65135ce2fe63

Contents?: true

Size: 779 Bytes

Versions: 5

Compression:

Stored size: 779 Bytes

Contents

module Redwood

class ResumeMode < ComposeMode
  def initialize m
    super()
    @id = m.id
    @header, @body = parse_file m.draft_filename
    @header.delete "Date"
    @header["Message-Id"] = gen_message_id # generate a new'n
    regen_text
    @safe = false
  end

  def killable?
    unless @safe
      case BufferManager.ask_yes_or_no "Discard draft?"
      when true
        DraftManager.discard @id
        BufferManager.flash "Draft discarded."
        true
      when false
        BufferManager.flash "Draft saved."
        true
      else
        false
      end
    end
  end

  def send_message
    if super
      DraftManager.discard @id 
      @safe = true
    end
  end

  def save_as_draft
    @safe = true
    DraftManager.discard @id if super
  end
end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sup-0.0.2 lib/sup/modes/resume-mode.rb
sup-0.0.3 lib/sup/modes/resume-mode.rb
sup-0.0.6 lib/sup/modes/resume-mode.rb
sup-0.0.4 lib/sup/modes/resume-mode.rb
sup-0.0.5 lib/sup/modes/resume-mode.rb