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
- #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.
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
#lines ⇒ Object (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
#color ⇒ Object
260 |
# File 'lib/sup/message-chunks.rb', line 260 def color; :quote_color end |
#expandable? ⇒ Boolean
253 |
# File 'lib/sup/message-chunks.rb', line 253 def ; true end |
#initial_state ⇒ Object
254 |
# File 'lib/sup/message-chunks.rb', line 254 def initial_state; :closed end |
#inlineable? ⇒ Boolean
251 |
# File 'lib/sup/message-chunks.rb', line 251 def inlineable?; false end |
#patina_color ⇒ Object
257 |
# File 'lib/sup/message-chunks.rb', line 257 def patina_color; :generic_notice_patina_color end |
#patina_text ⇒ Object
258 |
# File 'lib/sup/message-chunks.rb', line 258 def patina_text; "Begin enclosed message sent on #{@date}" end |
#quotable? ⇒ Boolean
252 |
# File 'lib/sup/message-chunks.rb', line 252 def quotable?; false end |
#viewable? ⇒ Boolean
255 |
# File 'lib/sup/message-chunks.rb', line 255 def viewable?; false end |