Class: MOLGENIS::MolgenisModel

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

Overview

The model for a given MOLGENIS model

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMolgenisModel

Creates an empty model a



10
11
12
13
# File 'lib/molgenis_model.rb', line 10

def initialize
  @entities = []
  @modules = []
end

Instance Attribute Details

#descriptionObject

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

#entitiesObject

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

#labelObject

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

#modulesObject

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

#nameObject

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

#versionObject

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_entitiesObject



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_countObject



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