Class: Redwood::Chunk::EnclosedMessage

Inherits:
Object
  • Object
show all
Defined in:
lib/sup/message_chunks.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(from, to, cc, date, subj) ⇒ EnclosedMessage

Returns a new instance of EnclosedMessage.



285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
# File 'lib/sup/message_chunks.rb', line 285

def initialize from, to, cc, date, subj
  @from = !from ? "unknown sender" : from.full_address
  @to = !to ? "" : to.map { |p| p.full_address }.join(", ")
  @cc = !cc ? "" : cc.map { |p| p.full_address }.join(", ")
  @date = !date ? "" : date.rfc822
  @subj = subj
  @lines = [
    "From: #{@from}",
    "To: #{@to}",
    "Cc: #{@cc}",
    "Date: #{@date}",
    "Subject: #{@subj}"
  ]
  @lines.delete_if{ |line| line == 'Cc: ' }
end

Instance Attribute Details

#linesObject (readonly)

Returns the value of attribute lines.



284
285
286
# File 'lib/sup/message_chunks.rb', line 284

def lines
  @lines
end

Instance Method Details

#colorObject



315
# File 'lib/sup/message_chunks.rb', line 315

def color; :quote_color end

#expandable?Boolean

Returns:

  • (Boolean)


303
# File 'lib/sup/message_chunks.rb', line 303

def expandable?; true end

#indexable?Boolean

Returns:

  • (Boolean)


304
# File 'lib/sup/message_chunks.rb', line 304

def indexable?; true end

#initial_stateObject



305
# File 'lib/sup/message_chunks.rb', line 305

def initial_state; :closed end

#inlineable?Boolean

Returns:

  • (Boolean)


301
# File 'lib/sup/message_chunks.rb', line 301

def inlineable?; false end

#patina_colorObject



308
# File 'lib/sup/message_chunks.rb', line 308

def patina_color; :generic_notice_patina_color end

#patina_textObject



309
310
311
312
313
# File 'lib/sup/message_chunks.rb', line 309

def patina_text
  "Begin enclosed message" + (
    @date == "" ? "" : " sent on #{@date}"
  )
end

#quotable?Boolean

Returns:

  • (Boolean)


302
# File 'lib/sup/message_chunks.rb', line 302

def quotable?; false end

#viewable?Boolean

Returns:

  • (Boolean)


306
# File 'lib/sup/message_chunks.rb', line 306

def viewable?; false end