Class: MOLGENIS::MolgenisModel
- Inherits:
-
Object
- Object
- MOLGENIS::MolgenisModel
- Defined in:
- lib/molgenis_model.rb
Overview
The model for a given MOLGENIS model
Instance Attribute Summary collapse
-
#description ⇒ Object
The list of all the entities that make up the model.
-
#entities ⇒ Object
The list of all the entities that make up the model.
-
#label ⇒ Object
The list of all the entities that make up the model.
-
#modules ⇒ Object
The list of all the entities that make up the model.
-
#name ⇒ Object
The list of all the entities that make up the model.
-
#version ⇒ Object
The list of all the entities that make up the model.
Instance Method Summary collapse
- #all_entities ⇒ Object
- #field_count ⇒ Object
-
#initialize ⇒ MolgenisModel
constructor
Creates an empty model a.
Constructor Details
#initialize ⇒ MolgenisModel
Creates an empty model a
10 11 12 13 |
# File 'lib/molgenis_model.rb', line 10 def initialize @entities = [] @modules = [] end |
Instance Attribute Details
#description ⇒ Object
The list of all the entities that make up the model
7 8 9 |
# File 'lib/molgenis_model.rb', line 7 def description @description end |
#entities ⇒ Object
The list of all the entities that make up the model
7 8 9 |
# File 'lib/molgenis_model.rb', line 7 def entities @entities end |
#label ⇒ Object
The list of all the entities that make up the model
7 8 9 |
# File 'lib/molgenis_model.rb', line 7 def label @label end |
#modules ⇒ Object
The list of all the entities that make up the model
7 8 9 |
# File 'lib/molgenis_model.rb', line 7 def modules @modules end |
#name ⇒ Object
The list of all the entities that make up the model
7 8 9 |
# File 'lib/molgenis_model.rb', line 7 def name @name end |
#version ⇒ Object
The list of all the entities that make up the model
7 8 9 |
# File 'lib/molgenis_model.rb', line 7 def version @version end |
Instance Method Details
#all_entities ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/molgenis_model.rb', line 15 def all_entities all_entities = [] @entities.each{|entity| all_entities << entity } @modules.each { |module_obj| module_obj.entities.each {|entity| all_entities << entity } } #puts all_entities.size #puts @modules.size all_entities end |
#field_count ⇒ Object
31 32 33 34 35 36 37 38 39 |
# File 'lib/molgenis_model.rb', line 31 def field_count count = 0; all_entities.each do |e| e.fields.each do |f| count = count + 1 end end count end |