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.



261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# File 'lib/sup/message_chunks.rb', line 261

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.



260
261
262
# File 'lib/sup/message_chunks.rb', line 260

def lines
  @lines
end

Instance Method Details

#colorObject



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

def color; :quote_color end

#expandable?Boolean

Returns:

  • (Boolean)


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

def expandable?; true end

#indexable?Boolean

Returns:

  • (Boolean)


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

def indexable?; true end

#initial_stateObject



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

def initial_state; :closed end

#inlineable?Boolean

Returns:

  • (Boolean)


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

def inlineable?; false end

#patina_colorObject



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

def patina_color; :generic_notice_patina_color end

#patina_textObject



285
286
287
288
289
# File 'lib/sup/message_chunks.rb', line 285

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

#quotable?Boolean

Returns:

  • (Boolean)


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

def quotable?; false end

#viewable?Boolean

Returns:

  • (Boolean)


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

def viewable?; false end