Class: MList::Thread::Node

Inherits:
Message
  • Object
show all
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

Attributes inherited from Message

#recipients

Instance Method Summary collapse

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(message)
  super
  @children = []
end

Instance Attribute Details

#childrenObject (readonly)

Returns the value of attribute children.



76
77
78
# File 'lib/mlist/thread.rb', line 76

def children
  @children
end

#nextObject

Returns the value of attribute next.



75
76
77
# File 'lib/mlist/thread.rb', line 75

def next
  @next
end

#parent_nodeObject

Returns the value of attribute parent_node.



75
76
77
# File 'lib/mlist/thread.rb', line 75

def parent_node
  @parent_node
end

#previousObject

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

Returns:

  • (Boolean)


83
84
85
# File 'lib/mlist/thread.rb', line 83

def leaf?
  children.empty?
end

#root?Boolean

Returns:

  • (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