class RbUMLClass

Attributes

interfaces[R]
kind[W]
name[R]
notes[R]
parents[R]
relationships[R]

Public Class Methods

new(name, kind=:class) click to toggle source
# File lib/rbuml/models.rb, line 9
def initialize(name, kind=:class)
        @name = name
        @parents = []
        @interfaces = []
        @attributes = []
        @relationships = []
        @methods = []
        @notes = []
        @kind = kind
end

Public Instance Methods

add_attribute(attrib) click to toggle source
# File lib/rbuml/models.rb, line 28
def add_attribute(attrib)
        @attributes << attrib
end
add_interface(inter) click to toggle source
# File lib/rbuml/models.rb, line 24
def add_interface(inter)
        @interfaces << inter
end
add_method(method) click to toggle source
# File lib/rbuml/models.rb, line 36
def add_method(method)
        @methods << method
end
add_note(note) click to toggle source
# File lib/rbuml/models.rb, line 40
def add_note(note)
        @notes << note
end
add_parent(cls) click to toggle source
# File lib/rbuml/models.rb, line 20
def add_parent(cls)
        @parents << cls
end
add_relationship(rel) click to toggle source
# File lib/rbuml/models.rb, line 32
def add_relationship(rel)
        @relationships << rel
end
dot_label() click to toggle source
# File lib/rbuml/dot.rb, line 40
def dot_label
        kind_lookup = {
                :class => "",
                :enumeration => "&lt;&lt;enumeration&gt;&gt;\n",
                :interface => "&lt;&lt;interface&gt;&gt;\n",
        }
        attributes = @attributes.collect { |a| a.dot_label }.join('\l')
        methods = @methods.collect { |m| m.dot_label }.join('\l')
        "{#{kind_lookup[@kind]}#{@name}|#{attributes}\\l|#{methods}\\l}"
end