Class: Architect::Note

Inherits:
Node
  • Object
show all
Defined in:
lib/architect/note.rb

Overview

A note in a class diagram

Instance Attribute Summary collapse

Attributes inherited from Node

#name

Instance Method Summary collapse

Methods inherited from Node

#==

Constructor Details

#initialize(markup) ⇒ Note

Returns a new instance of Note.



7
8
9
10
11
# File 'lib/architect/note.rb', line 7

def initialize(markup)
  matches = /note:(.+)/i.match(markup)
  @markup = matches[1].strip
  @style = {shape: "note", style: "filled", fillcolor: "lightgrey"}
end

Instance Attribute Details

#graphnodeObject

Returns the value of attribute graphnode.



5
6
7
# File 'lib/architect/note.rb', line 5

def graphnode
  @graphnode
end

Instance Method Details

#graph(g) ⇒ Object



13
14
15
# File 'lib/architect/note.rb', line 13

def graph(g)
   @graphnode = g.add_nodes(@markup, @style)
end