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.
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
#lines ⇒ Object (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
#color ⇒ Object
291 |
# File 'lib/sup/message_chunks.rb', line 291 def color; :quote_color end |
#expandable? ⇒ Boolean
279 |
# File 'lib/sup/message_chunks.rb', line 279 def ; true end |
#indexable? ⇒ Boolean
280 |
# File 'lib/sup/message_chunks.rb', line 280 def indexable?; true end |
#initial_state ⇒ Object
281 |
# File 'lib/sup/message_chunks.rb', line 281 def initial_state; :closed end |
#inlineable? ⇒ Boolean
277 |
# File 'lib/sup/message_chunks.rb', line 277 def inlineable?; false end |
#patina_color ⇒ Object
284 |
# File 'lib/sup/message_chunks.rb', line 284 def patina_color; :generic_notice_patina_color end |
#patina_text ⇒ Object
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
278 |
# File 'lib/sup/message_chunks.rb', line 278 def quotable?; false end |
#viewable? ⇒ Boolean
282 |
# File 'lib/sup/message_chunks.rb', line 282 def viewable?; false end |