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.



230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
# File 'lib/sup/message-chunks.rb', line 230

def initialize from, to, cc, date, subj
  @from = from ? "unknown sender" : from.full_adress
  @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.



229
230
231
# File 'lib/sup/message-chunks.rb', line 229

def lines
  @lines
end

Instance Method Details

#colorObject



260
# File 'lib/sup/message-chunks.rb', line 260

def color; :quote_color end

#expandable?Boolean

Returns:

  • (Boolean)


253
# File 'lib/sup/message-chunks.rb', line 253

def expandable?; true end

#initial_stateObject



254
# File 'lib/sup/message-chunks.rb', line 254

def initial_state; :closed end

#inlineable?Boolean

Returns:

  • (Boolean)


251
# File 'lib/sup/message-chunks.rb', line 251

def inlineable?; false end

#patina_colorObject



257
# File 'lib/sup/message-chunks.rb', line 257

def patina_color; :generic_notice_patina_color end

#patina_textObject



258
# File 'lib/sup/message-chunks.rb', line 258

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

#quotable?Boolean

Returns:

  • (Boolean)


252
# File 'lib/sup/message-chunks.rb', line 252

def quotable?; false end

#viewable?Boolean

Returns:

  • (Boolean)


255
# File 'lib/sup/message-chunks.rb', line 255

def viewable?; false end