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.



270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
# File 'lib/sup/message_chunks.rb', line 270

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(", ")
  if date
    @date = date.rfc822
  else
    @date = ""
  end

  @subj = subj

  @lines = "\nFrom: #{from}\n"
  @lines += "To: #{to}\n"
  if !cc.empty?
    @lines += "Cc: #{cc}\n"
  end
  @lines += "Date: #{date}\n"
  @lines += "Subject: #{subj}\n\n"
end

Instance Attribute Details

#linesObject (readonly)

Returns the value of attribute lines.



269
270
271
# File 'lib/sup/message_chunks.rb', line 269

def lines
  @lines
end

Instance Method Details

#colorObject



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

def color; :quote_color end

#expandable?Boolean

Returns:

  • (Boolean)


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

def expandable?; true end

#initial_stateObject



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

def initial_state; :closed end

#inlineable?Boolean

Returns:

  • (Boolean)


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

def inlineable?; false end

#patina_colorObject



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

def patina_color; :generic_notice_patina_color end

#patina_textObject



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

def patina_text; "Begin enclosed message sent on #{@date}" end

#quotable?Boolean

Returns:

  • (Boolean)


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

def quotable?; false end

#viewable?Boolean

Returns:

  • (Boolean)


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

def viewable?; false end