Class: Expressir::Model::Declarations::Entity

Inherits:
Expressir::Model::Declaration show all
Includes:
Identifier
Defined in:
lib/expressir/model/declarations/entity.rb

Overview

Specified in ISO 10303-11:2004

  • section 9.2 Entity declaration

Instance Attribute Summary collapse

Attributes included from Identifier

#id, #remark_items, #remarks, #source

Attributes inherited from ModelElement

#parent

Instance Method Summary collapse

Methods inherited from ModelElement

#children_by_id, #find, from_hash, model_attr_accessor, model_attrs, #path, #reset_children_by_id, #to_hash, #to_liquid, #to_s

Constructor Details

#initialize(options = {}) ⇒ Entity

Returns a new instance of Entity.

Parameters:

  • options (Hash) (defaults to: {})

Options Hash (options):



26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/expressir/model/declarations/entity.rb', line 26

def initialize(options = {})
  initialize_identifier(options)

  @abstract = options[:abstract]
  @supertype_expression = options[:supertype_expression]
  @subtype_of = options[:subtype_of] || []
  @attributes = options[:attributes] || []
  @unique_rules = options[:unique_rules] || []
  @where_rules = options[:where_rules] || []
  @informal_propositions = options[:informal_propositions] || []

  super
end

Instance Attribute Details

#abstractBoolean

Returns:

  • (Boolean)


9
# File 'lib/expressir/model/declarations/entity.rb', line 9

model_attr_accessor :abstract, "Boolean"

#attributesArray<Attribute>

Returns:



12
# File 'lib/expressir/model/declarations/entity.rb', line 12

model_attr_accessor :attributes, "Array<Attribute>"

#informal_propositionsArray<RemarkItem>

Returns:



15
# File 'lib/expressir/model/declarations/entity.rb', line 15

model_attr_accessor :informal_propositions, "Array<RemarkItem>"

#subtype_ofArray<Reference>

Returns:



11
# File 'lib/expressir/model/declarations/entity.rb', line 11

model_attr_accessor :subtype_of, "Array<Reference>"

#supertype_expressionSupertypeExpression

Returns:



10
# File 'lib/expressir/model/declarations/entity.rb', line 10

model_attr_accessor :supertype_expression, "SupertypeExpression"

#unique_rulesArray<UniqueRule>

Returns:



13
# File 'lib/expressir/model/declarations/entity.rb', line 13

model_attr_accessor :unique_rules, "Array<UniqueRule>"

#where_rulesArray<WhereRule>

Returns:



14
# File 'lib/expressir/model/declarations/entity.rb', line 14

model_attr_accessor :where_rules, "Array<WhereRule>"

Instance Method Details

#childrenArray<Declaration>

Returns:



41
42
43
44
45
46
47
48
49
# File 'lib/expressir/model/declarations/entity.rb', line 41

def children
  [
    *attributes,
    *unique_rules,
    *where_rules,
    *informal_propositions,
    *remark_items,
  ]
end