Class: Model

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeModel

Returns a new instance of Model.



17
18
19
20
# File 'lib/mongoid_erd.rb', line 17

def initialize 
  @attrs = Hash.new
  @fields = Array.new 
end

Instance Attribute Details

#attrsObject

Returns the value of attribute attrs.



16
17
18
# File 'lib/mongoid_erd.rb', line 16

def attrs
  @attrs
end

#erd_labelObject

Returns the value of attribute erd_label.



16
17
18
# File 'lib/mongoid_erd.rb', line 16

def erd_label
  @erd_label
end

#fieldsObject

Returns the value of attribute fields.



16
17
18
# File 'lib/mongoid_erd.rb', line 16

def fields
  @fields
end

#nameObject

Returns the value of attribute name.



16
17
18
# File 'lib/mongoid_erd.rb', line 16

def name
  @name
end

#parentObject

Returns the value of attribute parent.



16
17
18
# File 'lib/mongoid_erd.rb', line 16

def parent
  @parent
end

#tagObject

Returns the value of attribute tag.



16
17
18
# File 'lib/mongoid_erd.rb', line 16

def tag
  @tag
end

Instance Method Details

#titleObject



22
23
24
# File 'lib/mongoid_erd.rb', line 22

def title
  "- [#{name}:#{erd_label}] -"
end