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.
275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 |
# File 'lib/sup/message_chunks.rb', line 275 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
#lines ⇒ Object (readonly)
Returns the value of attribute lines.
274 275 276 |
# File 'lib/sup/message_chunks.rb', line 274 def lines @lines end |
Instance Method Details
#color ⇒ Object
306 |
# File 'lib/sup/message_chunks.rb', line 306 def color; :quote_color end |
#expandable? ⇒ Boolean
298 |
# File 'lib/sup/message_chunks.rb', line 298 def ; true end |
#indexable? ⇒ Boolean
299 |
# File 'lib/sup/message_chunks.rb', line 299 def indexable?; true end |
#initial_state ⇒ Object
300 |
# File 'lib/sup/message_chunks.rb', line 300 def initial_state; :closed end |
#inlineable? ⇒ Boolean
296 |
# File 'lib/sup/message_chunks.rb', line 296 def inlineable?; false end |
#patina_color ⇒ Object
303 |
# File 'lib/sup/message_chunks.rb', line 303 def patina_color; :generic_notice_patina_color end |
#patina_text ⇒ Object
304 |
# File 'lib/sup/message_chunks.rb', line 304 def patina_text; "Begin enclosed message sent on #{@date}" end |
#quotable? ⇒ Boolean
297 |
# File 'lib/sup/message_chunks.rb', line 297 def quotable?; false end |
#viewable? ⇒ Boolean
301 |
# File 'lib/sup/message_chunks.rb', line 301 def viewable?; false end |