Class: Expressir::Model::Declarations::Attribute

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

Overview

Specified in ISO 10303-11:2004

  • section 9.2.1 Attributes

Constant Summary collapse

EXPLICIT =
:EXPLICIT
DERIVED =
:DERIVED
INVERSE =
:INVERSE

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 = {}) ⇒ Attribute

Returns a new instance of Attribute.

Parameters:

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

Options Hash (options):



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

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

  @kind = options[:kind]
  @supertype_attribute = options[:supertype_attribute]
  @optional = options[:optional]
  @type = options[:type]
  @expression = options[:expression]

  super
end

Instance Attribute Details

#expressionExpression

Returns:



17
# File 'lib/expressir/model/declarations/attribute.rb', line 17

model_attr_accessor :expression, 'Expression'

#kind:EXPLICIT, ...

Returns:

  • (:EXPLICIT, :DERIVED, :INVERSE)


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

model_attr_accessor :kind, ':EXPLICIT, :DERIVED, :INVERSE'

#optionalBoolean

Returns:

  • (Boolean)


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

model_attr_accessor :optional, 'Boolean'

#supertype_attributeReference

Returns:



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

model_attr_accessor :supertype_attribute, 'Reference'

#typeDataType

Returns:



16
# File 'lib/expressir/model/declarations/attribute.rb', line 16

model_attr_accessor :type, 'DataType'

Instance Method Details

#childrenArray<Declaration>

Returns:



39
40
41
42
43
# File 'lib/expressir/model/declarations/attribute.rb', line 39

def children
  [
    *remark_items
  ]
end