Class: Expressir::Liquid::Declarations::RuleDrop

Inherits:
Expressir::Liquid::DeclarationDrop show all
Includes:
IdentifierDrop
Defined in:
lib/expressir/liquid/declarations/rule_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) ⇒ RuleDrop

Returns a new instance of RuleDrop.



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

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

Instance Method Details

#applies_toObject



15
16
17
18
19
20
21
# File 'lib/expressir/liquid/declarations/rule_drop.rb', line 15

def applies_to
  return [] unless @model.applies_to

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

#constantsObject



63
64
65
66
67
68
69
# File 'lib/expressir/liquid/declarations/rule_drop.rb', line 63

def constants
  return [] unless @model.constants

  @model.constants.map do |item|
    ::Expressir::Liquid::Declarations::ConstantDrop.new(item)
  end
end

#entitiesObject



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

def entities
  return [] unless @model.entities

  @model.entities.map do |item|
    ::Expressir::Liquid::Declarations::EntityDrop.new(item)
  end
end

#functionsObject



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

def functions
  return [] unless @model.functions

  @model.functions.map do |item|
    ::Expressir::Liquid::Declarations::FunctionDrop.new(item)
  end
end

#informal_propositionsObject



95
96
97
98
99
100
101
# File 'lib/expressir/liquid/declarations/rule_drop.rb', line 95

def informal_propositions
  return [] unless @model.informal_propositions

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

#proceduresObject



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

def procedures
  return [] unless @model.procedures

  @model.procedures.map do |item|
    ::Expressir::Liquid::Declarations::ProcedureDrop.new(item)
  end
end

#statementsObject



79
80
81
82
83
84
85
# File 'lib/expressir/liquid/declarations/rule_drop.rb', line 79

def statements
  return [] unless @model.statements

  @model.statements.map do |item|
    ::Expressir::Liquid::StatementDrop.new(item)
  end
end

#subtype_constraintsObject



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

def subtype_constraints
  return [] unless @model.subtype_constraints

  @model.subtype_constraints.map do |item|
    ::Expressir::Liquid::Declarations::SubtypeConstraintDrop.new(item)
  end
end

#typesObject



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

def types
  return [] unless @model.types

  @model.types.map do |item|
    ::Expressir::Liquid::Declarations::TypeDrop.new(item)
  end
end

#variablesObject



71
72
73
74
75
76
77
# File 'lib/expressir/liquid/declarations/rule_drop.rb', line 71

def variables
  return [] unless @model.variables

  @model.variables.map do |item|
    ::Expressir::Liquid::Declarations::VariableDrop.new(item)
  end
end

#where_rulesObject



87
88
89
90
91
92
93
# File 'lib/expressir/liquid/declarations/rule_drop.rb', line 87

def where_rules
  return [] unless @model.where_rules

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