Class: Redwood::Chunk::EnclosedMessage
- Defined in:
- lib/sup/message_chunks.rb
Instance Attribute Summary collapse
-
#lines ⇒ Object
readonly
Returns the value of attribute lines.
Instance Method Summary collapse
- #color ⇒ Object
- #expandable? ⇒ Boolean
- #indexable? ⇒ Boolean
- #initial_state ⇒ Object
-
#initialize(from, to, cc, date, subj) ⇒ EnclosedMessage
constructor
A new instance of EnclosedMessage.
- #inlineable? ⇒ Boolean
- #patina_color ⇒ Object
- #patina_text ⇒ Object
- #quotable? ⇒ Boolean
- #viewable? ⇒ Boolean
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
#lines ⇒ Object (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
#color ⇒ Object
315 |
# File 'lib/sup/message_chunks.rb', line 315 def color; :quote_color end |
#expandable? ⇒ Boolean
303 |
# File 'lib/sup/message_chunks.rb', line 303 def ; true end |
#indexable? ⇒ Boolean
304 |
# File 'lib/sup/message_chunks.rb', line 304 def indexable?; true end |
#initial_state ⇒ Object
305 |
# File 'lib/sup/message_chunks.rb', line 305 def initial_state; :closed end |
#inlineable? ⇒ Boolean
301 |
# File 'lib/sup/message_chunks.rb', line 301 def inlineable?; false end |
#patina_color ⇒ Object
308 |
# File 'lib/sup/message_chunks.rb', line 308 def patina_color; :generic_notice_patina_color end |
#patina_text ⇒ Object
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
302 |
# File 'lib/sup/message_chunks.rb', line 302 def quotable?; false end |
#viewable? ⇒ Boolean
306 |
# File 'lib/sup/message_chunks.rb', line 306 def viewable?; false end |