Class: Expressir::Liquid::Declarations::EntityDrop

Inherits:
Expressir::Liquid::DeclarationDrop show all
Includes:
IdentifierDrop
Defined in:
lib/expressir/liquid/declarations/entity_drop.rb

Instance Method Summary collapse

Methods included from IdentifierDrop

#id, #initialize_identifier, #remark_items, #remarks, #source

Methods inherited from ModelElementDrop

#_class, #file, #source

Constructor Details

#initialize(model) ⇒ EntityDrop

Returns a new instance of EntityDrop.



9
10
11
12
13
# File 'lib/expressir/liquid/declarations/entity_drop.rb', line 9

def initialize(model)
  @model = model
  initialize_identifier(@model)
  super
end

Instance Method Details

#abstractObject



15
16
17
# File 'lib/expressir/liquid/declarations/entity_drop.rb', line 15

def abstract
  @model.abstract
end

#attributesObject



31
32
33
34
35
36
37
# File 'lib/expressir/liquid/declarations/entity_drop.rb', line 31

def attributes
  return [] unless @model.attributes

  @model.attributes.map do |item|
    ::Expressir::Liquid::Declarations::AttributeDrop.new(item)
  end
end

#informal_propositionsObject



55
56
57
58
59
60
61
# File 'lib/expressir/liquid/declarations/entity_drop.rb', line 55

def informal_propositions
  return [] unless @model.informal_propositions

  @model.informal_propositions.map do |item|
    ::Expressir::Liquid::Declarations::RemarkItemDrop.new(item)
  end
end

#subtype_ofObject



23
24
25
26
27
28
29
# File 'lib/expressir/liquid/declarations/entity_drop.rb', line 23

def subtype_of
  return [] unless @model.subtype_of

  @model.subtype_of.map do |item|
    drop_klass_by_model(item)
  end
end

#supertype_expressionObject



19
20
21
# File 'lib/expressir/liquid/declarations/entity_drop.rb', line 19

def supertype_expression
  drop_klass_by_model(@model.supertype_expression)
end

#unique_rulesObject



39
40
41
42
43
44
45
# File 'lib/expressir/liquid/declarations/entity_drop.rb', line 39

def unique_rules
  return [] unless @model.unique_rules

  @model.unique_rules.map do |item|
    ::Expressir::Liquid::Declarations::UniqueRuleDrop.new(item)
  end
end

#where_rulesObject



47
48
49
50
51
52
53
# File 'lib/expressir/liquid/declarations/entity_drop.rb', line 47

def where_rules
  return [] unless @model.where_rules

  @model.where_rules.map do |item|
    ::Expressir::Liquid::Declarations::WhereRuleDrop.new(item)
  end
end