Class: MList::Thread::Node
- Defined in:
- lib/mlist/thread.rb
Constant Summary
Constants included from Util::EmailHelpers
Util::EmailHelpers::AUTO_LINK_RE, Util::EmailHelpers::BRACKETS, Util::EmailHelpers::BRACKETS_RE, Util::EmailHelpers::HTML_ESCAPE, Util::EmailHelpers::REGARD_RE
Instance Attribute Summary collapse
-
#children ⇒ Object
readonly
Returns the value of attribute children.
-
#next ⇒ Object
Returns the value of attribute next.
-
#parent_node ⇒ Object
Returns the value of attribute parent_node.
-
#previous ⇒ Object
Returns the value of attribute previous.
Attributes inherited from Message
Instance Method Summary collapse
-
#initialize(message) ⇒ Node
constructor
A new instance of Node.
- #leaf? ⇒ Boolean
- #root? ⇒ Boolean
- #visit(&visitor) ⇒ Object
Methods inherited from Message
#delivery, #email_with_capture=, #html, #html_for_reply, #parent_with_identifier_capture=, #recipient_addresses, #subject_for_reply, #subscriber, #subscriber=, #text, #text_for_reply, #text_html
Methods included from Util::EmailHelpers
#auto_link_urls, #bracket, #escape_once, #header_sanitizer, #html_to_text, #normalize_new_lines, #remove_brackets, #remove_regard, #sanitize_header, #subscriber_name_and_address, #text_to_html, #text_to_quoted
Constructor Details
#initialize(message) ⇒ Node
Returns a new instance of Node.
78 79 80 81 |
# File 'lib/mlist/thread.rb', line 78 def initialize() super @children = [] end |
Instance Attribute Details
#children ⇒ Object (readonly)
Returns the value of attribute children.
76 77 78 |
# File 'lib/mlist/thread.rb', line 76 def children @children end |
#next ⇒ Object
Returns the value of attribute next.
75 76 77 |
# File 'lib/mlist/thread.rb', line 75 def next @next end |
#parent_node ⇒ Object
Returns the value of attribute parent_node.
75 76 77 |
# File 'lib/mlist/thread.rb', line 75 def parent_node @parent_node end |
#previous ⇒ Object
Returns the value of attribute previous.
75 76 77 |
# File 'lib/mlist/thread.rb', line 75 def previous @previous end |
Instance Method Details
#leaf? ⇒ Boolean
83 84 85 |
# File 'lib/mlist/thread.rb', line 83 def leaf? children.empty? end |
#root? ⇒ Boolean
87 88 89 |
# File 'lib/mlist/thread.rb', line 87 def root? parent_node.nil? end |
#visit(&visitor) ⇒ Object
91 92 93 94 |
# File 'lib/mlist/thread.rb', line 91 def visit(&visitor) visitor.call self children.each {|c| c.visit(&visitor)} end |