Dradis Note objects are associated with a Node. It is possible to create a tree structure of Nodes to hierarchically structure the information held in the repository.

Each Node has a :parent node and a :label. Nodes can also have many Attachment objects associated with them.

Methods
Public Instance methods
attachments()

Return all the Attachment objects associated with this Node.

    # File app/models/node.rb, line 30
30:   def attachments
31:     Attachment.find(:all, :conditions => {:node_id => self.id})
32:   end
to_json(options={})

Return the JSON structure representing this Node and any child nodes associated with it.

    # File app/models/node.rb, line 13
13:   def to_json(options={})
14:     json = '{"text":"'
15:     json << self.label
16:     json << '"'
17:     json << ',"id":"'
18:     json << self.attributes['id'].to_s
19:     json << '"'
20:     if (self.children.any?)
21:       json << ', "children":'
22:       json << self.children.to_json
23:     else
24:       #json << ',"leaf":true'
25:     end
26:     json << '}'
27:   end