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.
231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 |
# File 'lib/sup/message_chunks.rb', line 231 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.
230 231 232 |
# File 'lib/sup/message_chunks.rb', line 230 def lines @lines end |
Instance Method Details
#color ⇒ Object
261 |
# File 'lib/sup/message_chunks.rb', line 261 def color; :quote_color end |
#expandable? ⇒ Boolean
254 |
# File 'lib/sup/message_chunks.rb', line 254 def ; true end |
#initial_state ⇒ Object
255 |
# File 'lib/sup/message_chunks.rb', line 255 def initial_state; :closed end |
#inlineable? ⇒ Boolean
252 |
# File 'lib/sup/message_chunks.rb', line 252 def inlineable?; false end |
#patina_color ⇒ Object
258 |
# File 'lib/sup/message_chunks.rb', line 258 def patina_color; :generic_notice_patina_color end |
#patina_text ⇒ Object
259 |
# File 'lib/sup/message_chunks.rb', line 259 def patina_text; "Begin enclosed message sent on #{@date}" end |
#quotable? ⇒ Boolean
253 |
# File 'lib/sup/message_chunks.rb', line 253 def quotable?; false end |
#viewable? ⇒ Boolean
256 |
# File 'lib/sup/message_chunks.rb', line 256 def viewable?; false end |