class GlobalRegistryModels::RelationshipType::RelationshipType

Public Class Methods

new(params = {}) click to toggle source
Calls superclass method
# File lib/global_registry_models/relationship_type/relationship_type.rb, line 13
def initialize(params = {})
  super(params)
  create_involved_types([params["relationship1"],params["relationship2"]]) if params["relationship1"] && params["relationship2"] && !params["entity_type1_id"]
end

Public Instance Methods

involved_types() click to toggle source
# File lib/global_registry_models/relationship_type/relationship_type.rb, line 18
def involved_types
  @involved_types
end

Private Instance Methods

create_involved_types(relationships) click to toggle source
# File lib/global_registry_models/relationship_type/relationship_type.rb, line 24
def create_involved_types relationships
  @involved_types=[]
  relationships.each do |relationship|
    @involved_types << InvolvedType.new(relationship)
  end
end