Class: Opencdd::Relation

Inherits:
Entity
  • Object
show all
Defined in:
lib/opencdd/relation.rb

Constant Summary collapse

RELATION_TYPES =
{
  "FUNCTION"    => :function,
  "PREDICATION" => :predication,
}.freeze

Instance Method Summary collapse

Instance Method Details

#aggregation?Boolean

Returns:

  • (Boolean)


56
57
58
59
# File 'lib/opencdd/relation.rb', line 56

def aggregation?
  rt = relation_type
  rt ? rt.aggregation? : false
end

#association?Boolean

Returns:

  • (Boolean)


51
52
53
54
# File 'lib/opencdd/relation.rb', line 51

def association?
  rt = relation_type
  rt ? rt.association? : false
end

#composition?Boolean

Returns:

  • (Boolean)


61
62
63
64
# File 'lib/opencdd/relation.rb', line 61

def composition?
  rt = relation_type
  rt ? rt.composition? : false
end

#function?Boolean

Returns:

  • (Boolean)


46
47
48
49
# File 'lib/opencdd/relation.rb', line 46

def function?
  rt = relation_type
  rt ? rt.function? : false
end

#generalization?Boolean

Returns:

  • (Boolean)


66
67
68
69
# File 'lib/opencdd/relation.rb', line 66

def generalization?
  rt = relation_type
  rt ? rt.generalization? : false
end

#predication?Boolean

Returns:

  • (Boolean)


41
42
43
44
# File 'lib/opencdd/relation.rb', line 41

def predication?
  rt = relation_type
  rt ? rt.predication? : false
end

#relation_type_symbolObject



36
37
38
39
# File 'lib/opencdd/relation.rb', line 36

def relation_type_symbol
  value = relation_type
  value ? value.to_sym : nil
end

#specialization?Boolean

Returns:

  • (Boolean)


71
72
73
74
# File 'lib/opencdd/relation.rb', line 71

def specialization?
  rt = relation_type
  rt ? rt.specialization? : false
end