Class: Fields

Inherits:
Object
  • Object
show all
Defined in:
lib/mongoid_erd.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#edgeObject

Returns the value of attribute edge.



6
7
8
# File 'lib/mongoid_erd.rb', line 6

def edge
  @edge
end

#erd_labelObject

Returns the value of attribute erd_label.



6
7
8
# File 'lib/mongoid_erd.rb', line 6

def erd_label
  @erd_label
end

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/mongoid_erd.rb', line 6

def name
  @name
end

#typeObject

Returns the value of attribute type.



6
7
8
# File 'lib/mongoid_erd.rb', line 6

def type
  @type
end

Instance Method Details

#as_rowObject



7
8
9
10
11
12
# File 'lib/mongoid_erd.rb', line 7

def as_row
  str = type == "function" ? '+ ' + name : '- ' + name
  str += ":" + type unless type == "function"
  str += ", #{erd_label}" if erd_label and erd_label.size > 0
  str
end